Strategy vault / Trend following
Multi Period SuperTrend Dynamic Trading Strategy
This strategy is an automated trading system based on the SuperTrend indicator, generating trading signals by analyzing price crossovers with the SuperTrend line. The strategy employs fixed ATR period and multiplier…

Overview
This strategy is an automated trading system based on the SuperTrend indicator, generating trading signals by analyzing price crossovers with the SuperTrend line. The strategy employs fixed ATR period and multiplier parameters, combining price crossover direction with the SuperTrend line to determine market trends, achieving an organic integration of trend following and capital management.
Strategy Principle
The core of the strategy utilizes the SuperTrend indicator, which is constructed based on the ATR (Average True Range) volatility indicator. Specific implementation includes:
- Setting ATR period to 10 and multiplier to 2.0 for calculating the SuperTrend line
- Generating long signals when closing price crosses above the SuperTrend line
- Generating short signals when closing price crosses below the SuperTrend line
- Using SuperTrend line as trailing stop-loss during position holding for dynamic risk control
Strategy Advantages
- Strong trend following capability: SuperTrend indicator effectively identifies market trends, helping the strategy profit in major trend directions
- Comprehensive risk control: Employs trailing stop-loss mechanism for effective profit locking and drawdown control
- Simple and stable parameters: Only requires setting ATR period and multiplier parameters, reducing over-optimization risk
- Wide adaptability: Applicable to different markets and time periods with good universality
- Clear signals: Trading signals are distinct, easy to execute and backtest
Strategy Risks
- Choppy market risk: Prone to frequent trading in sideways markets, leading to excessive losses
- Slippage impact: May face significant slippage in fast markets, affecting strategy performance
- False breakout risk: Market may exhibit false breakouts, leading to incorrect signals
- Parameter sensitivity: ATR parameter selection affects strategy performance, requiring careful setting
Strategy Optimization Directions
- Multi-period optimization: Combine SuperTrend signals from multiple timeframes to improve signal reliability
- Volatility adaptation: Dynamically adjust ATR multiplier based on market volatility to enhance adaptability
- Volume confirmation: Incorporate volume indicators to filter false breakout signals
- Stop-loss mechanism optimization: Set additional stop-loss conditions at key price levels
- Trend strength integration: Add trend strength filters to reduce trading in choppy markets
Summary
This is a well-structured and logically rigorous trend-following strategy. Through the dynamic characteristics of the SuperTrend indicator, it achieves unity in trend capture and risk control. The strategy demonstrates strong practicality and extensibility, and through appropriate parameter settings and implementation of optimization directions, it shows promise for stable performance in live trading.
Source Pine Script
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-09 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Commodity KIng", overlay=true)
// Supertrend Parameters
atr_period = 10 // Fixed ATR Period
atr_multiplier = 2.0 // Fixed ATR Multiplier
// Calculate Supertrend
[supertrend, direction] = ta.supertrend(atr_multiplier, atr_period)
// Plot Supertrend with reversed colors
plot(supertrend, color=direction > 0 ? color.red : color.green, title="Supertrend", linewidth=2)
// Buy and Sell Conditions
longCondition = ta.crossover(close, supertrend) // Buy when price crosses above Supertrend
shortCondition = ta.crossunder(close, supertrend) // Sell when price crosses below Supertrend
// Execute Buy and Sell Orders
if (longCondition)
strategy.entry("Buy", strategy.long)
if (shortCondition)
strategy.entry("Sell", strategy.short)
// Exit Conditions
if (shortCondition)
strategy.close("Buy") // Close long position if price crosses below Supertrend
if (longCondition)
strategy.close("Sell") // Close short position if price crosses above Supertrend
// Alerts
if (longCondition)
alert("Buy Signal: " + str.tostring(close), alert.freq_once_per_bar)
if (shortCondition)
alert("Sell Signal: " + str.tostring(close), alert.freq_once_per_bar)Published by ChaoZhang on the FMZ strategy square · last modified 2024-12-11. 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/Multi-Period-SuperTrend-Dynamic-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
- Advanced Dual EMA and Supertrend Combination Trading StrategyPine Script · Trend following · 1h
- Dual EMA Crossover Trend Following Strategy with ATR and ADX FiltersPine Script · Trend following · 1d
- Multi Indicator Fusion Automated Trading System SuperTrend ATR RSI Dynamic Risk Control StrategyPine Script · Trend following · 1d
- Dual EMA Golden Cross Trading StrategyPine Script · Trend following · 5m
- Dynamic Dual Supertrend Volume Price StrategyPine Script · Trend following · 1d
- Intelligent Multi Dimensional Adaptive Trend Trading SystemPine Script · Trend following · 1h