1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
128 lines of Pine Script v6 from pinescript/macro_session_quarters.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
Macro boxes cover a set number of minutes before and after each hour and follow the high and low of that window. A session ribbon shows Asia, London and New York blocks using Singapore time, and quarter boxes divide the day into 90-minute sections based on the chart timeframe. Window length and all box and border colours are adjustable. The pane is separate, with macro boxes forced onto the price chart. It has no signals.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Minutes Before/After Hour
int
10
windowMinutes
Macro Box Color
color
color.new(#2195f3, 100)
boxColor
Macro Border Color
color
color.new(#000000, 0)
borderColor
Asia Session Box Color
color
color.new(#FFD700, 100)
asiaColor
London Session Box Color
color
color.new(#FF00FF, 100)
londonColor
New York Session Box Color
color
color.new(#00FF00, 100)
nyColor
Asia Session Border Color
color
color.new(#000000, 0)
asiaBorderColor
London Session Border Color
color
color.new(#000000, 0)
londonBorderColor
New York Session Border Color
color
color.new(#000000, 0)
nyBorderColor
Quarter 1 Box Color
color
color.new(#FFD700, 100)
quarterColor1
Quarter 2 Box Color
color
color.new(#FFD700, 100)
quarterColor2
Quarter 3 Box Color
color
color.new(#FFD700, 100)
quarterColor3
Show all 17 settings
Setting
Type
Default
Variable
Quarter 4 Box Color
color
color.new(#FFD700,100)
quarterColor4
Quarter 1 Border Color
color
color.new(#000000, 0)
quarterBorderColor1
Quarter 2 Border Color
color
color.new(#000000, 0)
quarterBorderColor2
Quarter 3 Border Color
color
color.new(#000000, 0)
quarterBorderColor3
Quarter 4 Border Color
color
color.new(#000000, 0)
quarterBorderColor4
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.
This indicator plots a Supertrend-based trend-following setup in a separate pane and skips conditions it treats as a sideways market. A volatility range is built from an ATR value, with RMA, SMA, EMA, or WMA smoothing, or from a fixed point distance. Optional
Range Volume Change compares volume inside a chosen session window with the same window on the previous day and plots that change as a percentage. It accumulates volume during the window and, when enabled, volume outside it, drawing growing columns in a separa
Donald SPX - Options Trading is an indicator designed to assist SPX index option traders by tracking session benchmarks and multi-timeframe moving average data. It calculates a 200-period weighted moving average (WMA) and requests multi-timeframe bar data from
This indicator plots each bar's opening time as a numeric series in a separate pane. It uses Pine Script's built-in time value and draws one plot, not an overlay on price. There are no inputs, so the line follows the chart's bar timestamps without filters or o
This indicator summarizes higher-timeframe candle range statistics by time of day and shows them in a table in a separate pane. It groups candles into slots for 5-minute, 15-minute, 1-hour, 4-hour, 8-hour, or 12-hour periods over a chosen lookback in days, and
This indicator plots the active hours of major global trading sessions including Tokyo, Berlin, London, Sydney, and New York. It dynamically adjusts session times based on whether the instrument is classified as a traditional market or crypto. The script uses