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提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。