OPEN-SOURCE SCRIPT
US Election Cycles Lines

US Election Cycle Indicator (Buy the Dip Model)
This indicator visualizes the historical US presidential election cycle directly on the chart by automatically marking key dates based on real election calendars.
The core idea is a well-known long-term market pattern:
“Buy two years before the election, sell during the election year.”
🔍 What the indicator shows
• Vertical BUY lines — exactly 2 years before each US presidential election
• Vertical ELECTION lines — the actual US Election Day (November, Tuesday)
• Dates are calculated programmatically, not hardcoded
• Works on any market (S&P 500, Nasdaq, Crypto, Forex, Stocks)
⚙️ Customization
• Select start and end years
• Toggle BUY and ELECTION lines independently
• Adjustable colors, line styles, and thickness
• Optional labels for clean or annotated charts
• Timezone support (New York / UTC)
🧠 Why it matters
Over the past decades, markets have shown a strong tendency to perform positively in the period leading up to US elections, driven by liquidity expansion, fiscal stimulus, and political incentives.
This indicator helps you:
• Visually validate election-cycle theories
• Backtest long-term investment strategies
• Combine macro timing with technical or Smart Money analysis
• Avoid emotional decision-making during political cycles
⚠️ Disclaimer
This indicator is for educational and analytical purposes only.
It does not provide trading signals and should not be used as financial advice.
This indicator visualizes the historical US presidential election cycle directly on the chart by automatically marking key dates based on real election calendars.
The core idea is a well-known long-term market pattern:
“Buy two years before the election, sell during the election year.”
🔍 What the indicator shows
• Vertical BUY lines — exactly 2 years before each US presidential election
• Vertical ELECTION lines — the actual US Election Day (November, Tuesday)
• Dates are calculated programmatically, not hardcoded
• Works on any market (S&P 500, Nasdaq, Crypto, Forex, Stocks)
⚙️ Customization
• Select start and end years
• Toggle BUY and ELECTION lines independently
• Adjustable colors, line styles, and thickness
• Optional labels for clean or annotated charts
• Timezone support (New York / UTC)
🧠 Why it matters
Over the past decades, markets have shown a strong tendency to perform positively in the period leading up to US elections, driven by liquidity expansion, fiscal stimulus, and political incentives.
This indicator helps you:
• Visually validate election-cycle theories
• Backtest long-term investment strategies
• Combine macro timing with technical or Smart Money analysis
• Avoid emotional decision-making during political cycles
⚠️ Disclaimer
This indicator is for educational and analytical purposes only.
It does not provide trading signals and should not be used as financial advice.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.