OPEN-SOURCE SCRIPT
ATH / 52W Mechanical Breakout Strategy

This is a fully mechanical breakout strategy based on All-Time Highs and 52-Week Highs.
The system is built around a simple principle:
strength tends to lead to more strength.
When price breaks a significant high, momentum participants and trend followers enter the market. With no prior resistance above the level, price often has room to expand.
How It Works
• Detects breakouts above All-Time Highs or 52-Week Highs
• Enters long when a new high is created
• Exits using either:
– ATR trailing stop (Chandelier style)
– EMA close-based exit
The ATR stop automatically adjusts to volatility, keeping the system objective and rule-based.
Key Features
• Fully mechanical — no discretion required
• Works across stocks, indices, commodities and crypto
• Not over-optimised
• Designed for trend environments
• Removes emotional decision-making
Important Notes
This is a trend-following strategy. It will experience losing trades during sideways or choppy conditions. Its edge comes from capturing larger directional moves over time.
Always forward test and manage risk appropriately.
If you want something slightly shorter and more minimal (TradingView sometimes prefers concise):
Minimal Version
Mechanical breakout strategy using All-Time Highs and 52-Week Highs.
The system enters when price makes a new high and exits using either:
• ATR trailing stop
• EMA close-based exit
Designed to be simple, objective and robust across markets.
Trend-following systems will underperform in choppy conditions but aim to capture larger directional moves.
Not financial advice.
The system is built around a simple principle:
strength tends to lead to more strength.
When price breaks a significant high, momentum participants and trend followers enter the market. With no prior resistance above the level, price often has room to expand.
How It Works
• Detects breakouts above All-Time Highs or 52-Week Highs
• Enters long when a new high is created
• Exits using either:
– ATR trailing stop (Chandelier style)
– EMA close-based exit
The ATR stop automatically adjusts to volatility, keeping the system objective and rule-based.
Key Features
• Fully mechanical — no discretion required
• Works across stocks, indices, commodities and crypto
• Not over-optimised
• Designed for trend environments
• Removes emotional decision-making
Important Notes
This is a trend-following strategy. It will experience losing trades during sideways or choppy conditions. Its edge comes from capturing larger directional moves over time.
Always forward test and manage risk appropriately.
If you want something slightly shorter and more minimal (TradingView sometimes prefers concise):
Minimal Version
Mechanical breakout strategy using All-Time Highs and 52-Week Highs.
The system enters when price makes a new high and exits using either:
• ATR trailing stop
• EMA close-based exit
Designed to be simple, objective and robust across markets.
Trend-following systems will underperform in choppy conditions but aim to capture larger directional moves.
Not financial advice.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.