Indicator · Pine Script v5 · On the chart

PipAtlas Economic Calendar Lines

by pipatlas26

PipAtlas Economic Calendar Lines marks user-specified scheduled economic events directly on the main price chart.

View on GitHub

GitHub stars1on the repository
Pine versionv5runs as is
Lines of code47
Settings18inputs
LicenceMIT
Last update12 days ago12 Nov 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

47 lines of Pine Script v5 from tradingview/pipatlas-economic-calendar.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

pipatlas-economic-calendar.pine
//@version=5
//  PipAtlas Economic Calendar Lines — https://pipatlas.com/tools
//  Draws dotted event lines (with name labels) at the times you enter,
//  plus a 15-minute pre-event alert condition. Enter event times from
//  your own calendar source. Education only, never financial advice.
indicator("PipAtlas Economic Calendar Lines", overlay=true, max_lines_count=50, max_labels_count=50)

i_t1 = input.time(timestamp(2026, 1, 1, 0, 0), "Event 1 time", inline = "e1")
i_n1 = input.string("NFP", "", inline = "e1")
i_g1 = input.string("high", "impact (high/med/low)", inline = "e1")
i_t2 = input.time(timestamp(2026, 1, 1, 0, 0), "Event 2 time", inline = "e2")
i_n2 = input.string("CPI", "", inline = "e2")
i_g2 = input.string("high", "", inline = "e2")
i_t3 = input.time(timestamp(2026, 1, 1, 0, 0), "Event 3 time", inline = "e3")
i_n3 = input.string("Rate decision", "", inline = "e3")
i_g3 = input.string("high", "", inline = "e3")
i_t4 = input.time(timestamp(2026, 1, 1, 0, 0), "Event 4 time", inline = "e4")
i_n4 = input.string("GDP", "", inline = "e4")
i_g4 = input.string("med", "", inline = "e4")
i_t5 = input.time(timestamp(2026, 1, 1, 0, 0), "Event 5 time", inline = "e5")
i_n5 = input.string("PMI", "", inline = "e5")
i_g5 = input.string("med", "", inline = "e5")
i_t6 = input.time(timestamp(2026, 1, 1, 0, 0), "Event 6 time", inline = "e6")
i_n6 = input.string("Other", "", inline = "e6")
i_g6 = input.string("low", "", inline = "e6")

impactColor(imp) => imp == "high" ? color.red : imp == "med" ? color.orange : color.gray

drawEvent(t, name, imp) =>
    if t > 0
        hi = ta.highest(high, 30)
        lo = ta.lowest(low, 30)
        line.new(x1 = t, y1 = lo, x2 = t, y2 = hi, xloc = xloc.bar_time, color = impactColor(imp), style = line.style_dotted, width = 1)
        label.new(x = t, y = hi, text = name, xloc = xloc.bar_time, style = label.style_label_down, color = impactColor(imp), textcolor = color.white, size = size.small)

var bool drawn = false
if barstate.islast and not drawn
    drawn := true
    drawEvent(i_t1, i_n1, i_g1)
    drawEvent(i_t2, i_n2, i_g2)
    drawEvent(i_t3, i_n3, i_g3)
    drawEvent(i_t4, i_n4, i_g4)
    drawEvent(i_t5, i_n5, i_g5)
    drawEvent(i_t6, i_n6, i_g6)

soon(t) => t > 0 and time <= t and t - time <= 15 * 60 * 1000
alertcondition(soon(i_t1) or soon(i_t2) or soon(i_t3) or soon(i_t4) or soon(i_t5) or soon(i_t6), "PipAtlas: event within 15 min", "High-impact economic event within 15 minutes")

Overview

Traders manually input up to six event timestamps, event titles (such as NFP, CPI, or GDP), and impact ratings. The indicator draws vertical dotted lines extending across recent price highs and lows, color-coding them by impact level (red for high, orange for medium, and gray for low). It also triggers a pre-event alert 15 minutes before any configured event occurs.

Details

Published by

pipatlas26 on GitHub

Draws

On the price chart

Markets

Forex

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Topics

expert-advisorforexmetatrader5mql4mql5pinescriptposition-sizingrisk-managementtrading-indicatorstradingview

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Event 1 timetimetimestamp(2026, 1, 1, 0, 0)i_t1
i_n1stringNFPi_n1
impact (high/med/low)stringhighi_g1
Event 2 timetimetimestamp(2026, 1, 1, 0, 0)i_t2
i_n2stringCPIi_n2
i_g2stringhighi_g2
Event 3 timetimetimestamp(2026, 1, 1, 0, 0)i_t3
i_n3stringRate decisioni_n3
i_g3stringhighi_g3
Event 4 timetimetimestamp(2026, 1, 1, 0, 0)i_t4
i_n4stringGDPi_n4
i_g4stringmedi_g4
Show all 18 settings
SettingTypeDefaultVariable
Event 5 timetimetimestamp(2026, 1, 1, 0, 0)i_t5
i_n5stringPMIi_n5
i_g5stringmedi_g5
Event 6 timetimetimestamp(2026, 1, 1, 0, 0)i_t6
i_n6stringOtheri_n6
i_g6stringlowi_g6
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

947 stars

This indicator counts down to a fixed Litecoin halving timestamp in August 2019, using Greenwich Mean Time. It subtracts the current time from that stamp and formats the remaining days, hours, minutes, and seconds. The day, hour, and minute of the target are u

Indicator v4 Sessions & time
Updated 5 weeks ago · GPL-3.0 GitHub repository of Litecoin Halving UTC Countdown
575 stars

This indicator builds Market Profile Time Price Opportunity (TPO) structures across defined session timeframes directly on the main price chart. It visualizes the Point of Control (POC) and Value Area boundaries using dynamic box drawings. An integrated multi-

Indicator v5 Support & resistanceScreeners & dashboards
Updated 1 year ago · MPL-2.0 GitHub repository of Market Profile with Screener

This indicator identifies and plots key options expiration dates on the price chart. It calculates monthly OpEx (the third Friday of each month), quarterly OpEx (March, June, September, December), and corresponding VIX expiration dates, drawing vertical lines

Indicator v6 Sessions & time
Updated 8 days ago · MIT GitHub repository of Expiration Highlights: Opex, Quarterly Opex & VIX with Vanna/Charm
257 stars

This indicator plots auto trade signals for E-mini S&P 500 futures on the price chart. It computes an EMA200 filter along with day ETH RTH session levels and percentage-based entry zones. Signals trigger CALL or PUT cases when price crosses defined thresholds

Indicator v6 TrendSupport & resistance
Updated 2 months ago · None stated GitHub repository of Auto Trade Futures ES

Golden Bullet Strategy

by TradersPost
228 stars

The Golden Bullet Strategy is an overlay signal indicator based on Smart Money Concepts and time-based liquidity models. It identifies liquidity sweeps of a designated reference session range during a specified hunt window. It then confirms Market Structure Sh

Indicator v6 SMC / ICT / price actionSessions & time
Updated 4 months ago · None stated GitHub repository of Golden Bullet Strategy
219 stars

This indicator plots reference levels for previous daily high and low prices directly on the price chart. It requests daily timeframe data using the security function and plots the offset values as continuous lines, displaying resistance in red and support in

Indicator v4 Support & resistanceSessions & time
Updated 5 years ago · None stated GitHub repository of 昨日高低點標示

More Sessions & time scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers