OPEN-SOURCE SCRIPT
Estrategia Trend Following: 52w/26w Breakout

This is a classic long-term Trend Following strategy, heavily inspired by the Donchian Channel system and the legendary "Turtle Trading" rules. It is designed to capture major market moves (bull runs) while filtering out short-term market noise and volatility.
This script is ideal for investors and swing traders who prefer a "hands-off" approach, looking to catch large trends rather than day-trading small fluctuations.
How it Works:
1. Entry Condition (The Breakout):
52-Week High: The strategy enters a Long position when the price breaks above the highest high of the last 252 trading days (approx. 1 year).
SuperTrend Filter: An additional filter using the SuperTrend indicator ensures that the breakout is supported by positive momentum, helping to reduce false signals during choppy lateral markets.
2. Exit Condition (The Trailing Stop):
26-Week Low: The strategy ignores short-term corrections. It only closes the position if the price closes below the lowest low of the last 126 trading days (approx. 6 months).
This wide stop allows the trade to "breathe" and stay open during significant pullbacks, ensuring you stay in the trend for as long as possible.
Features & Settings:
Customizable Lookback Periods: You can adjust the Entry (default 252 days) and Exit (default 126 days) periods in the settings menu.
Visual Aids:
Blue Line: Represents the 1-Year High (Entry Threshold).
Red Line: Represents the 6-Month Low (Dynamic Stop Loss).
Channel Shading: Visualizes the trading range between the high and low.
Labels: Clearly marks "BUY" and "EXIT" points on the chart.
Recommended Usage:
Timeframe: Daily (1D). This logic is designed for daily candles.
Assets: Works best on assets with strong trending characteristics (e.g., Bitcoin/Crypto, Tech Stocks, Indices like SPX/NDX, and Commodities).
Patience Required: This strategy generates very few signals. It may stay quiet for months and then hold a position for over a year.
This script is ideal for investors and swing traders who prefer a "hands-off" approach, looking to catch large trends rather than day-trading small fluctuations.
How it Works:
1. Entry Condition (The Breakout):
52-Week High: The strategy enters a Long position when the price breaks above the highest high of the last 252 trading days (approx. 1 year).
SuperTrend Filter: An additional filter using the SuperTrend indicator ensures that the breakout is supported by positive momentum, helping to reduce false signals during choppy lateral markets.
2. Exit Condition (The Trailing Stop):
26-Week Low: The strategy ignores short-term corrections. It only closes the position if the price closes below the lowest low of the last 126 trading days (approx. 6 months).
This wide stop allows the trade to "breathe" and stay open during significant pullbacks, ensuring you stay in the trend for as long as possible.
Features & Settings:
Customizable Lookback Periods: You can adjust the Entry (default 252 days) and Exit (default 126 days) periods in the settings menu.
Visual Aids:
Blue Line: Represents the 1-Year High (Entry Threshold).
Red Line: Represents the 6-Month Low (Dynamic Stop Loss).
Channel Shading: Visualizes the trading range between the high and low.
Labels: Clearly marks "BUY" and "EXIT" points on the chart.
Recommended Usage:
Timeframe: Daily (1D). This logic is designed for daily candles.
Assets: Works best on assets with strong trending characteristics (e.g., Bitcoin/Crypto, Tech Stocks, Indices like SPX/NDX, and Commodities).
Patience Required: This strategy generates very few signals. It may stay quiet for months and then hold a position for over a year.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.