Turtle Breakout Drawdown Adaptive Trading Strategy
This strategy is mainly based on the trend breakout principle, combined with the channel breakout method, using fast and slow double rails to break through to determine the trend direction. The strategy has double…

Overview
This strategy is mainly based on the trend breakout principle, combined with the channel breakout method, using fast and slow double rails to break through to determine the trend direction. The strategy has double protection of breakout entries and drawdown exits at the same time, which can effectively deal with sudden market changes. The biggest advantage of the strategy is that it can monitor the account drawdown in real time. When the drawdown exceeds a certain percentage, it will actively reduce the position size. This allows the strategy to effectively control market risk and account risk resistance.
Strategy Logic
Fast and slow double rails: Fast and slow lines are used to build channels respectively. The fast line responds faster and the slow line is smoother. Determine the trend direction by combining double rail breakthroughs.
Breakout entries: go long when the price breaks through the upward channel, and go short when it breaks through the downward channel. Use stop orders to reduce risk.
Drawdown exits: Real-time monitoring of maximum drawdown. Once the drawdown exit point is reached, it will actively stop loss to close positions. The drawdown exit point can be adjusted according to market conditions.
Adaptive position sizing: The number of positions is adjusted in real time based on account equity to avoid market risk. The smaller the account drawdown, the fewer positions held. Stronger risk resistance.
Advantages
Double rail channel + breakout entries, more accurate trend judgment.
Stop loss and take profit mechanism effectively controls single loss.
Real-time monitoring of account drawdown and active adjustment of position size to reduce market risk.
Position size is linked to account equity with strong risk resistance to cope with sudden market changes.
Risks
Drawdown control may fail in volatile markets, leading to greater losses.
Multiple invalid breakthrough signals may occur when the fast line enters the neutral zone.
The slow line is too smooth to capture rapid reversal trends in time.
There is a risk of lock-in with mixed long and short positions.
Optimization
Set higher drawdown tolerance for volatile markets to avoid over stop loss.
Add neutral zone filtering to avoid invalid signals.
Optimize parameters of the slow channel to improve response speed to fast markets.
Add opening order sorting rules to avoid lock-in with two-way positions.
Conclusion
Overall, this is an effective strategy suitable for medium and long term trend trading. The biggest advantage of the strategy is real-time drawdown monitoring and dynamic adjustment of positions. This allows the strategy to automatically adjust the position size with strong adaptability to the market. When there is a sharp market change or price fluctuation, the strategy can automatically reduce the position size to effectively prevent the loss from expanding. This is difficult for many traditional strategies. In general, the idea of this strategy is innovative with strong practicality. It is worth exploring and optimizing for application.
Parameters
| Name | Default | What it controls |
|---|---|---|
| v_input_1 | true | Long |
| v_input_2 | false | Short |
| v_input_3 | 100 | Lot long, % |
| v_input_4 | 100 | Lot short, % |
| v_input_5 | true | Fast |
| v_input_6 | true | Slow |
| v_input_7 | 20 | enter_fast |
| v_input_8 | 10 | exit_fast |
| v_input_9 | 55 | enter_slow |
| v_input_10 | 20 | exit_slow |
| v_input_11 | true | Show offset |
| v_input_12 | false | Show lines |
| v_input_13 | true | Show label |
| v_input_14 | 1900 | From Year |
| v_input_15 | 2100 | To Year |
| v_input_16 | true | From Month |
| v_input_17 | 12 | To Month |
| v_input_18 | true | From day |
| v_input_19 | 31 | To day |
Source Pine Script
//Noro
//2020
//Original idea from «Way of the Turtle: The Secret Methods that Turned Ordinary People into Legendary Traders» (2007, CURTIS FAITH, ISBN: 9780071486644)
//@version=4
strategy("Noro's Turtles Strategy", shorttitle = "Turtles str", overlay = true, default_qty_type = strategy.percent_of_equity, initial_capital = 100, default_qty_value = 100, commission_value = 0.1)
//Settings
needlong = input(true, title = "Long")
needshort = input(false, title = "Short")
sizelong = input(100, defval = 100, minval = 1, maxval = 10000, title = "Lot long, %")
sizeshort = input(100, defval = 100, minval = 1, maxval = 10000, title = "Lot short, %")
needfast = input(true, title = "Fast")
needslow = input(true, title = "Slow")
enter_fast = input(20, minval=1)
exit_fast = input(10, minval=1)
enter_slow = input(55, minval=1)
exit_slow = input(20, minval=1)
showof = input(true, title = "Show offset")
showll = input(false, title = "Show lines")
showlabel = input(true, defval = true, title = "Show label")
fromyear = input(1900, defval = 1900, minval = 1900, maxval = 2100, title = "From Year")
toyear = input(2100, defval = 2100, minval = 1900, maxval = 2100, title = "To Year")
frommonth = input(01, defval = 01, minval = 01, maxval = 12, title = "From Month")
tomonth = input(12, defval = 12, minval = 01, maxval = 12, title = "To Month")
fromday = input(01, defval = 01, minval = 01, maxval = 31, title = "From day")
today = input(31, defval = 31, minval = 01, maxval = 31, title = "To day")
//Fast
fastL = highest(enter_fast)
fastLC = lowest(exit_fast)
fastS = lowest(enter_fast)
fastSC = highest(exit_fast)
//Slow
slowL = highest(enter_slow)
slowLC = lowest(exit_slow)
slowS = lowest(enter_slow)
slowSC = highest(exit_slow)
//Lines
offset = showof ? 1 : 0
col1 = showll and needlong and needfast ? color.blue : na
col2 = showll and needshort and needfast ? color.red : na
col3 = showll and needlong and needslow ? color.blue : na
col4 = showll and needshort and needslow ? color.red : na
plot(fastL, color = col1, offset = offset)
plot(fastLC, color = col1, offset = offset)
plot(fastS, color = col2, offset = offset)
plot(fastSC, color = col2, offset = offset)
plot(slowL, color = col3, offset = offset)
plot(slowLC, color = col3, offset = offset)
plot(slowS, color = col4, offset = offset)
plot(slowSC, color = col4, offset = offset)
//Orders
truetime = time > timestamp(fromyear, frommonth, fromday, 00, 00) and time < timestamp(toyear, tomonth, today, 23, 59)
size = strategy.position_size
lotlong = 0.0
lotlong := size != size[1] ? strategy.equity / close * sizelong / 100 : lotlong[1]
lotshort = 0.0
lotshort := size != size[1] ? strategy.equity / close * sizeshort / 100 : lotshort[1]
//Fast
strategy.entry("fast L", strategy.long, lotlong, stop = fastL, when = needfast and needlong and strategy.position_size == 0 and truetime)
strategy.entry("fast S", strategy.short, lotshort, stop = fastS, when = needfast and needshort and strategy.position_size == 0 and truetime)
strategy.exit("fast L", stop = fastLC, when = needfast and needlong and strategy.position_size > 0)
strategy.exit("fast S", stop = fastSC, when = needfast and needshort and strategy.position_size < 0)
//Slow
strategy.entry("slow L", strategy.long, lotlong, stop = slowL, when = needslow and needlong and strategy.position_size == 0 and truetime)
strategy.entry("slow S", strategy.short, lotshort, stop = slowS, when = needslow and needshort and strategy.position_size == 0 and truetime)
strategy.exit("slow L", stop = slowLC, when = needslow and needlong and strategy.position_size > 0)
strategy.exit("slow S", stop = slowSC, when = needslow and needshort and strategy.position_size < 0)
if time > timestamp(toyear, tomonth, today, 23, 59)
strategy.close_all()
strategy.cancel("fast L")
strategy.cancel("fast S")
strategy.cancel("slow L")
strategy.cancel("slow S")
if showlabel
//Drawdown
max = 0.0
max := max(strategy.equity, nz(max[1]))
dd = (strategy.equity / max - 1) * 100
min = 100.0
min := min(dd, nz(min[1]))
//Label
min := round(min * 100) / 100
labeltext = "Drawdown: " + tostring(min) + "%"
var label la = na
label.delete(la)
tc = min > -100 ? color.white : color.red
osx = timenow + round(change(time)*10)
osy = highest(100)
Published by ChaoZhang on the FMZ strategy square · last modified 2023-12-08. 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/Turtle-Breakout-Drawdown-Adaptive-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
- 5 Day Moving Average Channel Breakout Strategy Combined With Mileage ConceptPine Script · Breakout · 1d
- ATR Trailing Stops StrategyPine Script · Breakout · 1h
- ATR Trend Breakout StrategyPine Script · Breakout · 1d
- Adaptive Bollinger Breakout with Moving Average Quantitative Strategy SystemPine Script · Breakout · 1h
- Adaptive Channel Breakout StrategyPine Script · Breakout · 1d
- Adaptive Multi Period Trading Strategy Based on Wave Trend Momentum BreakoutPine Script · Breakout · 2h