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.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.