OPEN-SOURCE SCRIPT
Turtles Strategy

Born from the 1980s "Turtle" experiment, this method of trading captures breakouts and places or closes trades with intrabar entries or exits and realized-equity risk controls.
How It Works
The strategy buys/sells on breakouts from recent highs/lows, using ATR for volatility-adjusted stops and sizing. It risks a fixed % (default 1%) of realized equity per trade—initial capital plus closed P&L, ignoring open positions for conservatism. Drawdown protection auto-reduces risk by 20% at 10% drops (up to three times), resetting only on full peak recovery. Single positions only, with 1-tick slippage simulated for realistic fills. Best for trending assets like forex,commodities, crypto, stocks. Backtest for optimal parameters.
Main Operations
The strategy works on any timeframe but it's meant to be used on daily charts.
Entry Signals:
Long: Buy-stop 1 tick above 20-bar high (default "Entry Period") when no position—enters intrabar on breakout.
Short: Sell-stop 1 tick below 20-bar low. OCA cancels opposites.
Size: (Realized equity × adjusted risk %) ÷ (2× ATR stop distance), scaled by point value.
Exit Signals:
Longs: Stop at tighter of (entry - 2× ATR) or (10-bar low - 1 tick trailing, default "Exit Period").
Shorts: Stop at tighter of (entry + 2× ATR) or (10-bar high + 1 tick trailing).
Locks profits in trends, exits fast on fades.
Risk Controls:
Tracks realized equity peak.
10% drawdown: Risk ×0.8; 20%/30%: Further ×0.8 (max 3x).
Full reset above peak—preserves capital in slumps.
How It Works
The strategy buys/sells on breakouts from recent highs/lows, using ATR for volatility-adjusted stops and sizing. It risks a fixed % (default 1%) of realized equity per trade—initial capital plus closed P&L, ignoring open positions for conservatism. Drawdown protection auto-reduces risk by 20% at 10% drops (up to three times), resetting only on full peak recovery. Single positions only, with 1-tick slippage simulated for realistic fills. Best for trending assets like forex,commodities, crypto, stocks. Backtest for optimal parameters.
Main Operations
The strategy works on any timeframe but it's meant to be used on daily charts.
Entry Signals:
Long: Buy-stop 1 tick above 20-bar high (default "Entry Period") when no position—enters intrabar on breakout.
Short: Sell-stop 1 tick below 20-bar low. OCA cancels opposites.
Size: (Realized equity × adjusted risk %) ÷ (2× ATR stop distance), scaled by point value.
Exit Signals:
Longs: Stop at tighter of (entry - 2× ATR) or (10-bar low - 1 tick trailing, default "Exit Period").
Shorts: Stop at tighter of (entry + 2× ATR) or (10-bar high + 1 tick trailing).
Locks profits in trends, exits fast on fades.
Risk Controls:
Tracks realized equity peak.
10% drawdown: Risk ×0.8; 20%/30%: Further ×0.8 (max 3x).
Full reset above peak—preserves capital in slumps.
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。