OPEN-SOURCE SCRIPT
Squared9 Pro v1

Squared9 Pro v1.0 (strategy) combines classic Gann geometry with modern momentum checks to find high-conviction reversal zones.
The strategy requires:
1. Price to be within a user-defined percentage of Gann levels (based on recent pivot highs/lows and Square of Nine calculations).
2. Divergence on Stochastic and/or MACD (price and indicator moving in opposite directions).
3. Current price to respect the trend direction on a higher timeframe EMA.
4. A candle with a strong body relative to its range.
Here's what it looks for:
- Price is close to important Gann levels (calculated from recent swing highs/lows using Square of Nine math — shown as colored horizontal lines).
- Stochastic and MACD indicators show divergence (price makes new high/low but indicators do not — a classic reversal clue).
- The overall trend on a higher timeframe (default 4-hour) supports the trade direction via a 50-period EMA filter.
- The current candle has a strong directional body (not a doji or tiny range — minimum body size is adjustable).
When these line up, a green triangle appears below the bar for a potential long entry, or a red triangle above for short. Stop-loss and take-profit are set automatically using ATR multiples (default 1.7× for stop, 3.2× for target), with an optional trailing stop.
All settings (lookback periods, tolerances, ATR multipliers, etc.) can be changed in the inputs panel.
This script is designed for traders who want confluence-based signals rather than relying on a single indicator.
Feedback is welcome.
The strategy requires:
1. Price to be within a user-defined percentage of Gann levels (based on recent pivot highs/lows and Square of Nine calculations).
2. Divergence on Stochastic and/or MACD (price and indicator moving in opposite directions).
3. Current price to respect the trend direction on a higher timeframe EMA.
4. A candle with a strong body relative to its range.
Here's what it looks for:
- Price is close to important Gann levels (calculated from recent swing highs/lows using Square of Nine math — shown as colored horizontal lines).
- Stochastic and MACD indicators show divergence (price makes new high/low but indicators do not — a classic reversal clue).
- The overall trend on a higher timeframe (default 4-hour) supports the trade direction via a 50-period EMA filter.
- The current candle has a strong directional body (not a doji or tiny range — minimum body size is adjustable).
When these line up, a green triangle appears below the bar for a potential long entry, or a red triangle above for short. Stop-loss and take-profit are set automatically using ATR multiples (default 1.7× for stop, 3.2× for target), with an optional trailing stop.
All settings (lookback periods, tolerances, ATR multipliers, etc.) can be changed in the inputs panel.
This script is designed for traders who want confluence-based signals rather than relying on a single indicator.
Feedback is welcome.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.