This strategy uses two ATR stops with different parameters to set dynamic stop loss levels - one fast stop and one slow stop. It establishes long positions based on price breakouts of the different stop levels and exits positions using the trailing stops. The goal is to use ATR stops to set reasonable stop loss levels while maximizing the trend following ability.
The strategy uses ATR indicator to calculate two stop loss levels. The fast stop uses 5-period ATR multiplied by 0.5 as the stop distance. The slow stop uses 10-period ATR multiplied by 3 as the stop distance. When price breaks above the fast stop level, a long position is established. When price continues to break above the slow stop level, the stop is adjusted to the slow stop level. If price turns down, the stop level is adjusted based on the crossover relationships.
The logic is:
Calculate fast stop Trail1: 5-period ATR * 0.5
Calculate slow stop Trail2: 10-period ATR * 3
When price breaks above Trail1, establish long position
When price continues to break above Trail2, adjust stop to Trail2
If price turns down breaking Trail1, adjust stop back to Trail1
If price continues down breaking Trail2, adjust stop to Trail2
Finally, if price hits the stop level, exit the position with stop loss
This way, the strategy can maximize the profit during uptrends with the trailing stops while quickly stopping out losses when the trend reverses. The two stops also balance between capturing trends and limiting losses.
ATR stops set dynamic stop loss levels based on market volatility
Dual stop mechanism balances between stopping losses and trailing trends
Long direction aligns with overall uptrend, higher profitability
Simple and clear logic, easy to understand and implement
Strict stop loss rules limit losses effectively
Improper ATR parameters may cause stops being too wide or too tight
Long direction has directional bias, prone to stops at market tops
Dual stop rules are complex, may fail if not set properly
No filters such as EMA crossovers, may cause bad trades
No position or risk management, risks of overtrading
These risks can be reduced by optimizing ATR parameters, adding filters, and enforcing risk management.
Optimize ATR parameter combinations for best results
Add filters like EMA to qualify entry signals
Incorporate indicators like Stoch RSI for additional edge
Add re-entry logic to optimize position management
Optimize risk management rules to limit per trade stop loss
Incorporate market-level analytics to avoid directional mistakes
Consider faster timeframe strategies like hourly
Expand to multi-market universal strategy
Deploy high performance trading engine
With these improvements, the strategy can be more robust, stable and profitable.
The strategy uses clear ATR trailing stops for long entries and exits. The advantages lie in its strict stop loss rules to limit losses while trailing trends. It has directional bias risks that can be reduced through optimizations like better parameters, adding filters and enhancing risk management. With further testing and improvements, this can become a reliable trend following strategy.
/*backtest start: 2023-10-25 00:00:00 end: 2023-11-01 00:00:00 period: 1m basePeriod: 1m exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=4 strategy("ATR Trailing Stop Strategy (Long Position Only)", overlay=true) SC = input(close, "Source", input.source) // Fast Trail AP1 = input(5, "Fast ATR period", input.integer) AF1 = input(0.5, "Fast ATR multiplier", input.float) SL1 = AF1 * atr(AP1) Trail1 = 0.0 Trail1 := iff(SC > nz(Trail1[1], 0) and SC[1] > nz(Trail1[1], 0), max(nz(Trail1[1], 0), SC - SL1), iff(SC < nz(Trail1[1], 0), SC + SL1, na)) // Slow Trail AP2 = input(10, "Slow ATR period", input.integer) AF2 = input(3, "Slow ATR multiplier", input.float) SL2 = AF2 * atr(AP2) Trail2 = 0.0 Trail2 := iff(SC > nz(Trail2[1], 0) and SC[1] > nz(Trail2[1], 0), max(nz(Trail2[1], 0), SC - SL2), iff(SC < nz(Trail2[1], 0), SC + SL2, na)) Green = Trail1 > Trail2 and close > Trail2 and low > Trail2 Buy = crossover(Trail1, Trail2) plotshape(Buy, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small) strategy.entry("Buy", strategy.long, when = Buy) var float trailingStopPrice = na if (Trail2 > trailingStopPrice) trailingStopPrice := Trail2 if (crossover(Trail1, Trail2)) trailingStopPrice := Trail2 strategy.exit("Exit", from_entry = "Buy", stop=trailingStopPrice)