OPEN-SOURCE SCRIPT
已更新 Turtle ATR Channel Breakout

🐢 Turtle ATR Channel Breakout
Turtle ATR Channel Breakout is a daily trend-following indicator based on an ATR channel breakout variation described in turtle-trading literature.

📊 Channel Calculation
* Basis: 350-day Simple Moving Average (SMA) of closing prices
* Volatility: 20-day Average True Range (ATR) using Wilder’s smoothing
* Upper Band: Basis + 7 × ATR
* Lower Band: Basis − 3 × ATR
🐢 Signal Logic
* A bullish turtle signal is generated when the previous confirmed daily close crosses from at or below the upper band to above the upper band.
* A bearish turtle signal is generated when the previous confirmed daily close crosses from at or above the lower band to below the lower band.
* Signals are displayed on the following trading day, ensuring that each breakout is confirmed by a completed daily close.
* Only the first confirmed close across a boundary generates a signal. If price remains outside the channel for multiple consecutive days, no duplicate signals are produced.
* If price returns inside the channel and later crosses the same boundary again, the new crossing is treated as a new breakout event.
⏱️ Daily Confirmation
The indicator always performs its calculations using daily data, regardless of the chart timeframe.
Intraday highs, intraday lows, and the current unconfirmed daily close are not used to confirm breakout signals. This helps prevent temporary intraday moves from being treated as confirmed breakouts.
⚙️ Customization
The script includes:
* Customizable channel colors
* Customizable bullish and bearish turtle-marker colors
* Optional channel filling
* Optional trend-based bar coloring
* Separate alert conditions for bullish and bearish breakouts
⚠️ Important
This indicator is designed to identify trend breakout events only.
It does not define:
* Position sizing
* Stop-loss levels
* Profit targets
* Portfolio allocation
* Trade execution rules
For research and educational purposes only. This indicator does not constitute financial advice or guarantee future results.
Turtle ATR Channel Breakout is a daily trend-following indicator based on an ATR channel breakout variation described in turtle-trading literature.
📊 Channel Calculation
* Basis: 350-day Simple Moving Average (SMA) of closing prices
* Volatility: 20-day Average True Range (ATR) using Wilder’s smoothing
* Upper Band: Basis + 7 × ATR
* Lower Band: Basis − 3 × ATR
🐢 Signal Logic
* A bullish turtle signal is generated when the previous confirmed daily close crosses from at or below the upper band to above the upper band.
* A bearish turtle signal is generated when the previous confirmed daily close crosses from at or above the lower band to below the lower band.
* Signals are displayed on the following trading day, ensuring that each breakout is confirmed by a completed daily close.
* Only the first confirmed close across a boundary generates a signal. If price remains outside the channel for multiple consecutive days, no duplicate signals are produced.
* If price returns inside the channel and later crosses the same boundary again, the new crossing is treated as a new breakout event.
⏱️ Daily Confirmation
The indicator always performs its calculations using daily data, regardless of the chart timeframe.
Intraday highs, intraday lows, and the current unconfirmed daily close are not used to confirm breakout signals. This helps prevent temporary intraday moves from being treated as confirmed breakouts.
⚙️ Customization
The script includes:
* Customizable channel colors
* Customizable bullish and bearish turtle-marker colors
* Optional channel filling
* Optional trend-based bar coloring
* Separate alert conditions for bullish and bearish breakouts
⚠️ Important
This indicator is designed to identify trend breakout events only.
It does not define:
* Position sizing
* Stop-loss levels
* Profit targets
* Portfolio allocation
* Trade execution rules
For research and educational purposes only. This indicator does not constitute financial advice or guarantee future results.
版本注释
Rewritten as a full Turtle-style breakout system.Channel
- Selectable width basis: standard deviation (original Bollinger Breakout) or ATR, measured in N.
- Presets for 350/2.5, 100/2.0 and 20/2.0, plus custom.
Exits
- Three methods: midline (original), 10-bar Donchian (the exit the turtles actually used), or a trailing N stop.
- Optional 2N hard stop, with intrabar or close-based triggering.
Position sizing
- N-based unit sizing from account equity and risk percentage.
- 0.5N pyramiding up to 4 units, spacing locked to the N captured at entry.
- Automatic drawdown-based size reduction driven by a simulated equity curve.
Filters
- Midline slope, long-term MA, higher timeframe trend, ADX, channel expansion, and the original
"skip if the last breakout was a winner" rule. Filtered breakouts are marked on the chart.
Panel
- Live N, half-width in N (warns when the stop makes the midline exit unreachable), unit count,
quantity per unit, stop and exit levels, active filters, and signal statistics.
Calculation is now locked to daily bars regardless of the chart timeframe.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。