OPEN-SOURCE SCRIPT
Seasonality Calculation & Statistics

Seasonality Calculation & Statistics
Key Features
Visual Chart Elements
Dashboard Tables
1. Summary Table: Displays overall strategy performance across the entire selected backtest horizon
2. Yearly Table: Provides a granular, year-by-year historical audit containing
3. Period Summary Table: Breaks down win rates across customizable historical segments (e.g., last 3, 5, 10, or 15 years) to help identify if a seasonal pattern is strengthening, decaying, or completely cooked in modern market regime
How to Use
- The Seasonality Calculation & Statistics indicator is a quantitative tool designed to backtest, track, and visually analyze specific seasonal recurring calendar patterns across historical data directly on the daily timeframe
- It eliminates guesswork by isolating user-defined date windows (e.g., May 1 to May 15), calculating historical performance metrics, projecting upcoming seasonal cycles, and providing detailed table dashboards
Key Features
- Custom Seasonal Windows: Define exact start and end dates (Day/Month) and evaluate both Long and Short seasonal directions
- Smart Vertical Timeline Markers: Clean visual boundaries marking every historical cycle and projecting upcoming future opportunities
- Shifted Exit Boundary for Visual Clarity: The vertical exit line is deliberately placed one trading day to the right ($t + 1$), cleanly enclosing the entire holding period so you can analyze every historical price bar inside the pattern without overlapping visual obstruction
- Three Built-in Statistical Tables: Comprehensive performance summaries, year-by-year logs, and multi-period lookback comparisons
- SQN & Risk Metrics: Real-time calculation of System Quality Number (SQN), Win Rate, Average Return, Average Profit, and Maximum/Average Drawdown
Visual Chart Elements
- Entry Line & Label: A vertical line (default lime) placed on the entry candle close
- Shifted Exit Line & Label: A vertical boundary line (default red) shifted one trading day to the right of the exit candle, framing the trade window perfectly for post-trade review
- Result Badges: Clean floating labels displaying the percentage return and maximum intra-trade drawdown for each individual year
- Future Projections: Forward-projected dashed lines plotted into empty chart space to highlight when the next seasonal window opens and closes
Dashboard Tables
1. Summary Table: Displays overall strategy performance across the entire selected backtest horizon
- Direction (Long / Short)
- Calendar Window & Trade Duration
- Winning Trades ratio and Win Rate percentage
- Average Return and Average Winning Trade Profit
- Average Drawdown and Maximum Intra-trade Drawdown
- System Quality Number (SQN) to evaluate statistical edge
2. Yearly Table: Provides a granular, year-by-year historical audit containing
- Specific trading cycle year
- Executed start and end dates
- Trade Return (%)
- Trade Maximum Drawdown (%)
3. Period Summary Table: Breaks down win rates across customizable historical segments (e.g., last 3, 5, 10, or 15 years) to help identify if a seasonal pattern is strengthening, decaying, or completely cooked in modern market regime
How to Use
- Apply the indicator to any asset on the Daily (1D) timeframe
- Set your desired seasonal window via Start Day / Start Month and End Day / End Month
- Select Long or Short bias
- Adjust the lookback starting years to focus on specific economic cycles
- Use the projected lines to prepare for upcoming seasonal setups ahead of time
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.