Indicator · Pine Script v5 · On the chart

Chart Champions Sessions

by ClimberMel

The Chart Champions Sessions indicator plots small square markers on the price chart to mark the start and end of major market sessions.

View on GitHub

GitHub stars2on the repository
Pine versionv5runs as is
Lines of code127
Settings24inputs
LicenceMIT
Last update4 years ago4 Apr 2022

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

127 lines of Pine Script v5 from code/CC - Pt3 - Sessions.txt, published under MIT. Keep the author's credit and licence lines when you reuse it.

CC - Pt3 - Sessions.txt

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// Code from Kg
// 2022-03-14: Modified by ClimberMel

//@version=5
indicator('Chart Champions Sessions', shorttitle='CC Sessions', overlay=true)


////////////////////////////////////////Input IGOR Sessions - Start

///Asia End of Session Start
AsiaInput = input.string('0000-0600', title='Asia', group='IGOR Sessions - Bottom Color Banner', inline='1')
AsiaSession = time('1', AsiaInput + ':1234567')
plotshape(AsiaSession, title='IGOR Asia', style=shape.square, location=location.bottom, color=color.new(color.purple, 0), size=size.tiny)
///Asia End of Session Finish


///London End of Session Start
LonInput = input.string('0600-1200', title='London', group='IGOR Sessions - Bottom Color Banner', inline='1')
LonSession = time('1', LonInput + ':1234567')
plotshape(LonSession, title='IGOR London', style=shape.square, location=location.bottom, color=color.new(color.yellow, 0), size=size.tiny)


///London End of Session Finish

///New York End of Session Start
NYInput = input.string('1200-2000', title='New York', group='IGOR Sessions - Bottom Color Banner', inline='2')
NYSession = time('1', NYInput + ':1234567')
plotshape(NYSession, title='IGOR New York', style=shape.square, location=location.bottom, color=color.new(color.blue, 0), size=size.tiny)
///New York End of Session Finish



///Close
CloseInput = input.string('2000-0000', title='Close', group='IGOR Sessions - Bottom Color Banner', inline='2')
CloseSession = time('1', CloseInput + ':1234567')
plotshape(CloseSession, title='IGOR Close', style=shape.square, location=location.bottom, color=color.new(color.red, 0), size=size.tiny)

////////////////////////////////////////Input IGOR Sessions - Finish



////////////////Pre Market and Market Open Information
showDOW = input.bool(true, title='Show Chart Text and Top Banner Color', group='Pre + Market Openings - Top Color Banner', tooltip='P = PreMarket, LSE = London Stock Exchange, NYSE = New York Stock Exchange. ASX = Australian Stock Exchange')

inputMaxInterval = input(30, title='Hides sessions above specified time')
loadIndicator = timeframe.isminutes and timeframe.multiplier <= inputMaxInterval



PreASXExact1 = input.string('2200-2201', title='Pre ASX Exact', group='ASX - Pre and Open Markets', inline='1')
PreASXExact = time(timeframe.period, PreASXExact1 + ':1234567')  //Exact PreMarket New York
PreASX1 = input.string('2200-0000', title='Pre ASX Period', group='ASX - Pre and Open Markets', inline='1')
PreASX = time(timeframe.period, PreASX1 + ':1234567')  //Market Open New York Period - configured to not overlap other markets
ASXExactOpen1 = input.string('0000-0001', title='ASX Exact Open', group='ASX - Pre and Open Markets', inline='2')
ASXExactOpen = time(timeframe.period, ASXExactOpen1 + ':1234567')  //Exact Open ASX
//ASXOpen = time(timeframe.period, "1430-2100:1234567") //Market Open ASX Period - configured to not overlap other markets ////Blanked due to overlapping
ASXExactClose1 = input.string('0600-0601', title='ASX Exact Close', group='ASX - Pre and Open Markets', inline='2')
ASXExactClose = time(timeframe.period, ASXExactClose1 + ':1234567')  //Exact Close ASX



AsiaExactOpen1 = input.string('0000-0001', title='Asia Exact Open', group='Asia Open Market', inline='1')
AsiaExactOpen = time(timeframe.period, AsiaExactOpen1 + ':1234567')  //Exact Open Asia
MorningAsia1 = input.string('0000-0230', title='Asia Morning Open Period', group='Asia Open Market', inline='1')
MorningAsia = time(timeframe.period, MorningAsia1 + ':1234567')  //Exact Morning Open Asia
AfternoonAsia1 = input.string('0330-0400', title='Asia Afternoon Open Period', group='Asia Open Market', inline='2')
AfternoonAsia = time(timeframe.period, AfternoonAsia1 + ':1234567')  //Exact Afternoon Open Asia
AsiaExactClose1 = input.string('0600-0601', title='Asia Exat Close', group='Asia Open Market', inline='2')
AsiaExactClose = time(timeframe.period, AsiaExactClose1 + ':1234567')  //Exact Close Asia



PreLondonExact1 = input.string('0400-0401', title='Pre LSE Exact', group='London - Pre and Open Markets', inline='1')
PreLondonExact = time(timeframe.period, PreLondonExact1 + ':1234567')  //Exact PreMarket London
PreLondon1 = input.string('0400-0650', title='Pre LSE Period', group='London - Pre and Open Markets', inline='1')
PreLondon = time(timeframe.period, PreLondon1 + ':1234567')  //Pre Market London Period
LondonExactOpen1 = input.string('0700-0701', title='LSE Open Exact', group='London - Pre and Open Markets', inline='2')
LondonExactOpen = time(timeframe.period, LondonExactOpen1 + ':1234567')  //Exact Open London
LondonOpen1 = input.string('0700-1030', title='LSE Open Period', group='London - Pre and Open Markets', inline='2')
LondonOpen = time(timeframe.period, LondonOpen1 + ':1234567')  //Market Open London Period - configured to not overlap other markets
LondonExactClose1 = input.string('1530-1531', title='LSE Exact Close', group='London - Pre and Open Markets')
LondonExactClose = time(timeframe.period, LondonExactClose1 + ':1234567')  //Exact Close London
//LondonClose1 = input("1530-1700", title="LSE Close", group = "London - Pre and Open Markets")
//LondonClose = time(timeframe.period, LondonClose1+":1234567") //


PreNYExact1 = input.string('1030-1031', title='Pre NY Exact', group='New York - Pre and Open Markets', inline='1')
PreNYExact = time(timeframe.period, PreNYExact1 + ':1234567')  //Exact PreMarket New York
PreNY1 = input.string('1030-1330', title='Pre NY Period', group='New York - Pre and Open Markets', inline='1')
PreNY = time(timeframe.period, PreNY1 + ':1234567')  //PreMarket New York

NYExactOpen1 = input.string('1330-1331', title='NY Exact Open', group='New York - Pre and Open Markets', inline='2')
NYExactOpen = time(timeframe.period, NYExactOpen1 + ':1234567')  //Exact Open New York

NYOpen1 = input.string('1330-2000', title='NY Open Period', group='New York - Pre and Open Markets', inline='2')
NYOpen = time(timeframe.period, NYOpen1 + ':1234567')  //Market Open New York Period - configured to not overlap other markets

NYExactClose1 = input.string('2000-2001', title='NY Exact Close', group='New York - Pre and Open Markets', inline='3')
NYExactClose = time(timeframe.period, NYExactClose1 + ':1234567')  //Exact Close New York


plotshape(loadIndicator and showDOW and not na(PreNY), title='Pre NYSE', style=shape.square, location=location.top, color=color.new(#283A90, 0), size=size.tiny)
plotshape(loadIndicator and showDOW and not na(NYOpen), title='NYSE Open', style=shape.square, location=location.top, color=color.new(#00008B, 0), size=size.tiny)

plotshape(loadIndicator and showDOW and not na(PreLondon), title='Pre LSE', style=shape.square, location=location.top, color=color.new(#CCCC00, 0), size=size.tiny)
plotshape(loadIndicator and showDOW and not na(LondonOpen), title='LSE Open', style=shape.square, location=location.top, color=color.new(#FFCC11, 0), size=size.tiny)


plotshape(loadIndicator and showDOW and not na(MorningAsia), title='Morning Asia', style=shape.square, location=location.top, color=color.new(#AA00FF, 0), size=size.tiny)
plotshape(loadIndicator and showDOW and not na(AfternoonAsia), title='Afternoon Asia', style=shape.square, location=location.top, color=color.new(#AA00FF, 0), size=size.tiny)


plotshape(loadIndicator and showDOW and not na(PreASX), title='ASX Open', style=shape.square, location=location.top, color=color.new(color.gray, 0), size=size.tiny)

plotshape(loadIndicator and showDOW and not na(NYExactOpen), title='NYSE Exact Opening', style=shape.square, location=location.top, color=color.new(color.green, 0), size=size.tiny, text='NYSE Open', textcolor=color.new(color.blue, 0))
plotshape(loadIndicator and showDOW and not na(NYExactClose), title='NYSE Exact Closing', style=shape.square, location=location.top, color=color.new(color.red, 0), size=size.tiny, text='NYSE Close', textcolor=color.new(color.blue, 0))
plotshape(loadIndicator and showDOW and not na(LondonExactOpen), title='LSE Exact Opening', style=shape.square, location=location.top, color=color.new(color.green, 0), size=size.tiny, text='LSE Open', textcolor=color.new(#FFCC11, 0))
plotshape(loadIndicator and showDOW and not na(LondonExactClose), title='LSE Exact Closing', style=shape.square, location=location.top, color=color.new(color.red, 0), size=size.tiny, text='LSE Close', textcolor=color.new(#FFCC11, 0))
plotshape(loadIndicator and showDOW and not na(AsiaExactOpen), title='Asia Exact Opening', style=shape.square, location=location.top, color=color.new(color.green, 0), size=size.tiny, text='Asia Open', textcolor=color.new(#AA00FF, 0))
plotshape(loadIndicator and showDOW and not na(AsiaExactClose), title='Asia Exact Closing', style=shape.square, location=location.top, color=color.new(color.red, 0), size=size.tiny, text='Asia Close', textcolor=color.new(#AA00FF, 0))
plotshape(loadIndicator and showDOW and not na(ASXExactOpen), title='ASX Exact Opening', style=shape.square, location=location.top, color=color.new(color.green, 0), size=size.tiny, text='   .    \n ASX Open', textcolor=color.new(color.gray, 0))
plotshape(loadIndicator and showDOW and not na(ASXExactClose), title='Asia Exact Closing', style=shape.square, location=location.top, color=color.new(color.red, 0), size=size.tiny, text='   .    \n ASX Close', textcolor=color.new(color.gray, 0))
plotshape(loadIndicator and showDOW and not na(PreNYExact), title='Pre NYSE Exact Opening', style=shape.square, location=location.top, color=color.new(color.green, 0), size=size.tiny, text='P-NYSE', textcolor=color.new(color.blue, 0))
plotshape(loadIndicator and showDOW and not na(PreASXExact), title='Sydney Exact Opening', style=shape.square, location=location.top, color=color.new(color.green, 0), size=size.tiny, text='Pre ASX', textcolor=color.new(color.gray, 0))
plotshape(loadIndicator and showDOW and not na(PreLondonExact), title='Pre LSE Exact Opening', style=shape.square, location=location.top, color=color.new(color.green, 0), size=size.tiny, text='P-LSE', textcolor=color.new(#FFCC11, 0))

Overview

Chart Champions Sessions covers Asia, London, New York, close, and specific ASX pre-market and open periods. A top banner dynamically changes color based on the current session when enabled. Multiple input settings allow customization of each session time range, with an option to hide sessions longer than a specified interval. The indicator uses time functions to detect exact session periods and draws markers at the bottom of the chart.

Details

Published by

ClimberMel on GitHub

Draws

On the price chart

Markets

Any symbol

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.

Settings

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

SettingTypeDefaultVariable
Asiastring0000-0600AsiaInput
Londonstring0600-1200LonInput
New Yorkstring1200-2000NYInput
Closestring2000-0000CloseInput
Show Chart Text and Top Banner ColorbooltrueshowDOW
Hides sessions above specified timeint30inputMaxInterval
Pre ASX Exactstring2200-2201PreASXExact1
Pre ASX Periodstring2200-0000PreASX1
ASX Exact Openstring0000-0001ASXExactOpen1
ASX Exact Closestring0600-0601ASXExactClose1
Asia Exact Openstring0000-0001AsiaExactOpen1
Asia Morning Open Periodstring0000-0230MorningAsia1
Show all 24 settings
SettingTypeDefaultVariable
Asia Afternoon Open Periodstring0330-0400AfternoonAsia1
Asia Exat Closestring0600-0601AsiaExactClose1
Pre LSE Exactstring0400-0401PreLondonExact1
Pre LSE Periodstring0400-0650PreLondon1
LSE Open Exactstring0700-0701LondonExactOpen1
LSE Open Periodstring0700-1030LondonOpen1
LSE Exact Closestring1530-1531LondonExactClose1
Pre NY Exactstring1030-1031PreNYExact1
Pre NY Periodstring1030-1330PreNY1
NY Exact Openstring1330-1331NYExactOpen1
NY Open Periodstring1330-2000NYOpen1
NY Exact Closestring2000-2001NYExactClose1
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 12 days 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 2 months 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 7 weeks 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 3 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