
The Multi-Timeframe Supertrend with Gann High-Low Breakout Strategy is a quantitative trading strategy based on technical analysis, combining the Supertrend indicator with Gann High-Low theory and enhancing signal reliability through multi-timeframe analysis. This strategy uses a higher timeframe (15-minute) to identify entry signals while confirming exit points on a lower timeframe (5-minute). The core concept involves entering positions when price breaks through key resistance or support levels and exiting promptly when reversal signals appear, using timeframe layering to filter out false signals and improve trading success rates.
The technical foundation of this strategy is built upon several key components:
Supertrend Indicator: This is a trend-following indicator based on ATR (Average True Range) that dynamically adapts to market volatility. In the code, it’s calculated using ta.supertrend(factor, atrPeriod), where factor is the multiplier (default 3.0) and atrPeriod is the ATR period (default 10). The Supertrend indicator appears red above price (bearish signal) and green below price (bullish signal).
Gann High-Low: This indicator from Gann analysis principles identifies support and resistance levels by calculating the highest and lowest prices within a specific period. In the code, it’s calculated using ta.highest(high, gannLength) and ta.lowest(low, gannLength), where gannLength is the lookback period (default 10).
Multi-Timeframe Analysis: The strategy calculates indicators on both 15-minute and 5-minute timeframes, using the higher timeframe (15-minute) to determine the overall trend and generate entry signals, while using the lower timeframe (5-minute) to capture short-term reversals and generate exit signals. Cross-timeframe data access is implemented through the request.security function.
Entry conditions are designed as follows:
- Long entry (longEntry): When price breaks above both the 15-minute Supertrend line and the 15-minute Gann High (close > st15 and close > gannHigh15)
- Short entry (shortEntry): When price breaks below both the 15-minute Supertrend line and the 15-minute Gann Low (close < st15 and close < gannLow15)
Exit conditions are designed as follows:
- Long exit (longExit): When price breaks below both the 5-minute Supertrend line and the 5-minute Gann High (close < st5 and close < gannHigh5)
- Short exit (shortExit): When price breaks above both the 5-minute Supertrend line and the 5-minute Gann Low (close > st5 and close > gannLow5)
The strategy execution logic is clear: positions are opened using the strategy.entry function when entry conditions are met, and closed using the strategy.close function when exit conditions are met.
Multi-Timeframe Collaborative Analysis: By combining signals from different timeframes, the strategy provides a more comprehensive view of market trends, avoiding the potential bias of a single timeframe analysis. The higher timeframe (15-minute) ensures entries align with the medium-term trend, while the lower timeframe (5-minute) provides more sensitive exit timing.
Dual Confirmation Mechanism: The strategy requires price to simultaneously break through both the Supertrend line and Gann High-Low points to trigger signals. This dual confirmation mechanism effectively reduces false breakouts and improves signal quality.
Dynamic Adaptation to Market Volatility: The Supertrend indicator, being based on ATR calculations, automatically adjusts parameters according to market volatility, maintaining strategy effectiveness across different market environments.
Clear Risk Control: Through well-defined exit conditions, the strategy can cut losses early in market reversals, effectively controlling risk per trade.
Parameter Customization: The strategy offers three key adjustable parameters—ATR period, Supertrend multiplier, and Gann High-Low period—allowing users to fine-tune based on different market characteristics and personal risk preferences.
Simple and Clear Execution Logic: The code structure is clean with straightforward logic, making it easy to understand and maintain, facilitating ongoing optimization and improvement.
Lag Risk: Both Supertrend and Gann High-Low are indicators calculated based on historical data, which may not respond quickly enough in highly volatile markets, causing delayed entry or exit signals. A solution is to reduce ATR and Gann High-Low periods in high-volatility environments to increase indicator sensitivity.
False Breakout Risk: In ranging markets, price may frequently break key levels only to retreat shortly after, increasing false signals. A solution is to add confirmation mechanisms in ranging markets, such as requiring breakouts to persist for a certain duration or magnitude before trading.
Parameter Sensitivity: Optimal parameters can vary significantly across different market environments. Overly aggressive parameter settings may lead to overtrading, while overly conservative ones might miss important opportunities. A solution is to identify robust parameter ranges through historical backtesting and periodically check parameter effectiveness.
Timeframe Conflict: In some cases, higher and lower timeframes may give contradictory signals, causing decision-making difficulties. A solution is to add weighting between timeframes or incorporate an even higher timeframe as a trend filter.
Insufficient Money Management: The strategy uses 10% of the account equity by default for each trade, which could lead to rapid capital depletion during consecutive losses. A solution is to dynamically adjust position size based on market volatility and expected risk, introducing a more sophisticated money management mechanism.
Add Trend Strength Filtering: Incorporate trend strength indicators such as ADX (Average Directional Index), executing trades only when trends are well-established to avoid frequent trading in oscillating markets. This can be implemented by adding ADX calculation logic and incorporating it as part of the entry conditions.
Optimize Exit Mechanisms: The current exit conditions mirror entry conditions and may lack flexibility. Consider adding diversified exit mechanisms such as trailing stops, profit targets, or volatility-based stops to better balance risk and reward.
Add Volume Confirmation: Price breakouts should be accompanied by significant volume to be more reliable. Add volume indicators for confirmation, such as requiring breakout volume to exceed the average volume of the past N periods.
Introduce Volatility Adjustment: Dynamically adjust the Supertrend multiplier based on current market volatility—using smaller multipliers in low-volatility periods to increase sensitivity and larger multipliers in high-volatility periods to reduce false signals.
Add Market State Classification: Implement logic to distinguish between trending and ranging markets, applying different trading strategies and parameter settings based on market state. For example, increase the Supertrend multiplier in ranging markets to reduce trading frequency.
Optimize Money Management: Dynamically adjust the equity percentage per trade based on volatility or expected risk ratio, rather than fixed at 10%. This can be achieved by calculating ATR to estimate stop-loss placement and determining position size accordingly.
Add Time Filters: Certain time periods (such as market open and pre-close) experience higher volatility and may generate false signals. Add time filters to avoid trading during these periods.
The Multi-Timeframe Supertrend with Gann High-Low Breakout Strategy is a quantitative trading system combining multiple technical analysis tools, capturing market opportunities by analyzing Supertrend and Gann High-Low points across different timeframes. The strategy’s main advantages lie in its multiple confirmation mechanisms and multi-timeframe analysis, effectively filtering noise and improving signal quality. However, it also faces risks such as parameter sensitivity, false breakouts, and timeframe conflicts.
By adding trend strength filtering, optimizing exit mechanisms, incorporating volume confirmation, and introducing volatility adjustments, the strategy’s robustness and adaptability can be further enhanced. Particularly promising is the combination of money management mechanisms with market state analysis, which could significantly improve the strategy’s risk-reward characteristics.
For traders seeking technical analysis-based quantitative strategies, this approach provides a solid foundation framework that can be applied directly or used as a component in more complex trading systems. Most importantly, traders should thoroughly backtest and optimize parameters based on their risk preferences and market understanding to achieve optimal results.
/*backtest
start: 2025-01-01 00:00:00
end: 2025-04-25 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"SOL_USDT"}]
*/
//@version=5
strategy("MTF Supertrend + Gann HL Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// === Inputs ===
atrPeriod = input.int(10, "ATR Period")
factor = input.float(3.0, "Supertrend Multiplier")
gannLength = input.int(10, "Gann HL Period")
// === Timeframes ===
higherTF = "15"
lowerTF = "5"
// === Supertrend & Gann HL (15m) ===
[st15, dir15] = request.security(syminfo.tickerid, higherTF, ta.supertrend(factor, atrPeriod))
gannHigh15 = request.security(syminfo.tickerid, higherTF, ta.highest(high, gannLength))
gannLow15 = request.security(syminfo.tickerid, higherTF, ta.lowest(low, gannLength))
// === Supertrend & Gann HL (5m) for exit ===
[st5, dir5] = request.security(syminfo.tickerid, lowerTF, ta.supertrend(factor, atrPeriod))
gannHigh5 = request.security(syminfo.tickerid, lowerTF, ta.highest(high, gannLength))
gannLow5 = request.security(syminfo.tickerid, lowerTF, ta.lowest(low, gannLength))
// === Entry Conditions (15m) ===
longEntry = close > st15 and close > gannHigh15
shortEntry = close < st15 and close < gannLow15
// === Exit Conditions (5m) ===
longExit = close < st5 and close < gannHigh5
shortExit = close > st5 and close > gannLow5
// === Execute Strategy ===
if (longEntry)
strategy.entry("Long", strategy.long)
if (shortEntry)
strategy.entry("Short", strategy.short)
if (longExit)
strategy.close("Long")
if (shortExit)
strategy.close("Short")
// === Optional Plots ===
plot(st15, color=dir15 ? color.green : color.red, title="Supertrend 15m")