Strategy vault / Trend following
Triple Supertrend and Exponential Moving Average Trend Following Quantitative Trading Strategy
This strategy combines triple Supertrend indicators with an Exponential Moving Average (EMA) for trend following. It uses three Supertrend lines with different sensitivities and one EMA line to capture market trends…

Overview
This strategy combines triple Supertrend indicators with an Exponential Moving Average (EMA) for trend following. It uses three Supertrend lines with different sensitivities and one EMA line to capture market trends through multi-dimensional confirmation. The strategy utilizes ATR (Average True Range) to calculate dynamic support/resistance levels and determines trend direction and trading signals based on price positions relative to these lines.
Strategy Principle
The strategy consists of these core components:
- 50-period EMA determines overall trend direction, with price above EMA indicating uptrend and below indicating downtrend.
- Three Supertrend lines calculated using 10-period ATR with multipliers of 3.0, 2.0, and 1.0, decreasing in sensitivity.
- Entry signals: Long when price is above EMA and all three Supertrend lines show bullish signals; Short when price is below EMA and all three Supertrend lines show bearish signals.
- Exit signals: Close positions when the third Supertrend line (least sensitive) reverses direction.
Strategy Advantages
- Multiple confirmation mechanism improves signal reliability and reduces false signals.
- Combines short-term and long-term trend indicators for both quick response and stability.
- Dynamic stop-loss settings that automatically adjust to market volatility.
- Clear strategy logic with adjustable parameters.
- Applicable across multiple market cycles with good universality.
Strategy Risks
May generate frequent trades in ranging markets, increasing transaction costs. Solution: Add signal filters or extend moving average periods.
Potential lag during trend reversal initiation. Solution: Incorporate momentum indicators for assistance.
Multiple confirmation requirements might miss some profitable opportunities. Solution: Adjust confirmation conditions based on market characteristics.
Strategy Optimization Directions
- Incorporate volume indicators for additional confirmation.
- Develop adaptive parameter mechanisms that adjust dynamically to market conditions.
- Add volatility filters to adjust position sizing during high volatility periods.
- Optimize stop-loss mechanism, considering trailing stops.
- Add drawdown control module with maximum drawdown limits.
Summary
This is a logically rigorous and stable trend-following strategy. Through the combination of multiple technical indicators, it ensures signal reliability while maintaining good risk control capabilities. The strategy parameters are highly adjustable and can be optimized for different market conditions. While there is some inherent lag, appropriate optimization can achieve a good balance between risk and return.
Source Pine Script
/*backtest
start: 2024-12-19 00:00:00
end: 2024-12-26 00:00:00
period: 45m
basePeriod: 45m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Supertrend EMA Strategy", overlay=true)
// Input Parameters
ema_length = input(50, title="EMA Length")
supertrend_atr_period = input(10, title="ATR Period")
supertrend_multiplier1 = input.float(3.0, title="Supertrend Multiplier 1")
supertrend_multiplier2 = input.float(2.0, title="Supertrend Multiplier 2")
supertrend_multiplier3 = input.float(1.0, title="Supertrend Multiplier 3")
// Calculations
emaValue = ta.ema(close, ema_length)
[supertrend1, SupertrendDirection1] = ta.supertrend(supertrend_multiplier1, supertrend_atr_period)
[supertrend2, SupertrendDirection2] = ta.supertrend(supertrend_multiplier2, supertrend_atr_period)
[supertrend3, SupertrendDirection3] = ta.supertrend(supertrend_multiplier3, supertrend_atr_period)
// Plot Indicators
plot(emaValue, title="EMA", color=color.blue, linewidth=2)
plot(supertrend1, title="Supertrend 1 (10,3)", color=(SupertrendDirection1 == -1 ? color.green : color.red), linewidth=1, style=plot.style_line)
plot(supertrend2, title="Supertrend 2 (10,2)", color=(SupertrendDirection2 == -1 ? color.green : color.red), linewidth=1, style=plot.style_line)
plot(supertrend3, title="Supertrend 3 (10,1)", color=(SupertrendDirection3 == -1 ? color.green : color.red), linewidth=1, style=plot.style_line)
// Entry Conditions
long_condition = (SupertrendDirection1 == -1 and SupertrendDirection2 == -1 and SupertrendDirection3 == -1 and close > emaValue)
short_condition = (SupertrendDirection1 == 1 and SupertrendDirection2 == 1 and SupertrendDirection3 == 1 and close < emaValue)
// Exit Conditions
long_exit = (SupertrendDirection3 == 1)
short_exit = (SupertrendDirection3 == -1)
// Execute Strategy
if (long_condition)
strategy.entry("Long", strategy.long)
if (short_condition)
strategy.entry("Short", strategy.short)
if (long_exit)
strategy.close("Long")
if (short_exit)
strategy.close("Short")
Published by ChaoZhang on the FMZ strategy square · last modified 2024-12-27. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Triple-Supertrend-and-Exponential-Moving-Average-Trend-Following-Quantitative-Trading-Strategy.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.
Related specs
- Multi Indicator Dynamic Trend Following Strategy Based on EMA and SMAPine Script · Trend following · 1d
- Trend Following Strategy Based on PMax IndicatorPine Script · Trend following · 5m
- Trend Tracking and Short term Trading Strategy Based on ADX IndicatorPine Script · Trend following · 1d
- Triple Supertrend Ichimoku Cloud Quantitative Trading StrategyPine Script · Trend following · 1d
- ADX Filtered SuperTrend Pivot Trading StrategyPine Script · Trend following · 1d
- Dynamic Multi Dimensional Trend Tracking and Quantitative Trading StrategyPine Script · Trend following · 3m