nicko

ICT - Show Different Sessions Open Price - horzontally and Vertically

Category: Indicators By: nicko Created: August 31, 2026, 8:54 AM
August 31, 2026, 8:54 AM
Indicators
0 Comments
ICT - Show Different Sessions Open Price - horzontally and Vertically

I am happy to share the code and I hope that is can be useful to others.

This is a simple code to be able to show both Session Open Price horizontal lines, and also vertical lines, for the benefit of looking at historical Price action.

I like ICT Concepts so I look at Asia, Midnight, London, NY am, 10 am (NY Time) and NY pm Opens. (This is based around having NY Times – you may need to adjust your trading/computer time or the times within the code ).

Ivan has written some wonderful code for ICT but I just wanted to see the Opens (I have code that gives me lines for the Highs/Lows of each session as well – but this has already been covered really well by Ivan)

I use it to quickly look back at historic open and market action between the various Opens (ie is the market moving in Asia sessions etc) and during the present day to understand what the Daily Candle is likely to look like by the end of the day.

Features –

NYAM NYPM Lon Asia etc – Turn ON/OFF which Sessions you want to see.

VertLine – Turn ON/OFF the Vertical lines.

Text – Turn ON/OFF Text – please note Text’s show to the right of the chart so you may need to create some space to be able to see these. (these may not show in after hours.

HistLines – Turn ON/OFF Historic Lines in previous days

Dist – The distance the text shows from the present price. You may want to vary according to the the chart Timescale.

Finish – To decide to what time you want the horizontal open lines to run to. Set to 5pm time by default. This is set for the same for all sessions but can be adjusted within the code individually.(instructions included)

 

For the benefit of people who do not know code, I have tried to put pointers in the code for you to understand what the pieces of code do and how you might be able to adjust it.


// ==========================================
// SESSION Open Horizontal and Vertical Lines
// ==========================================
// Created by Nick Collison and AI with some code used by kind code sharers of https://www.prorealcode.com
// Finish defines the time that you would like the Horizontal Line to finish
// Adjust start times according to your preference/ computer time (if you are in UK and your computer is set to UK time then NY time (in red) needs to be adjusted to 143000 etc)

Midnight = 1
Asia = 1
London = 1 
NYAM = 1
NYPM = 1
TenAM = 1
VertLine = 1
Text = 1
HistLines = 1
Dist = 5
Finish = 160000
 

// --- Session 1: Asia ---
AsiaStart = 190000 //Change to the relevant computer time)
AsiaFinish = Finish
ONCE AsiaActive = 0
ONCE StartBarAsia = 0
ONCE AsiaOpen = 0

IF opentime = AsiaStart THEN
StartBarAsia = barindex
AsiaOpen = open
AsiaActive = 1
ENDIF
IF opentime = AsiaFinish THEN
AsiaActive = 0
ENDIF

// --- Session 2: London Open ---
LondonStart = 030000 //Change to the relevant computer time)
LondonFinish = Finish
ONCE LondonActive = 0
ONCE StartBarLondon = 0
ONCE LondonOpen = 0

IF opentime = LondonStart THEN
StartBarLondon = barindex
LondonOpen = open
LondonActive = 1
ENDIF
IF opentime = LondonFinish THEN
LondonActive = 0
ENDIF

// --- Session 3: NY Open ---
NYStart = 093000 //Change to the relevant computer time)
NYFinish = Finish
ONCE NYActive = 0
ONCE StartBarNY = 0
ONCE NYOpen = 0

IF opentime = NYStart THEN
StartBarNY = barindex
NYOpen = open
NYActive = 1
ENDIF
IF opentime = NYFinish THEN
NYActive = 0
ENDIF

// --- Session 4: NY PM ---
NYPMStart = 133000 //Change to the relevant computer time)
NYPMFinish = Finish
ONCE NYPMActive = 0
ONCE StartBarNYPM = 0
ONCE NYPMOpen = 0

IF Time = NYPMStart THEN
StartBarNYPM = barindex
NYPMOpen = close
NYPMActive = 1
ENDIF
IF Time = NYPMFinish THEN
NYPMActive = 0
ENDIF

// --- Session 5: 10am ---
TenAMStart = 100000 //Change to the relevant computer time)
TenAMFinish = Finish
ONCE StartBarTenAM = 0
ONCE TenAMOpen = 0
ONCE TenAMActive = 0

IF Time = TenAMStart THEN
StartBarTenAM = barindex
TenAMOpen = close
TenAMActive = 1
ENDIF
IF Time = TenAMFinish THEN
TenAMActive = 0
ENDIF

// --- Session 6: Midnight Open ---
MidnightStart = 000000 //Change to the relevant computer time)
MidnightFinish = Finish
ONCE StartBarMidnight = 0
ONCE MidnightOpen = 0
ONCE MidnightActive = 0

IF Time = MidnightStart THEN
StartBarMidnight = barindex
MidnightOpen = close
MidnightActive = 1
ENDIF
IF Time = MidnightFinish THEN
MidnightActive = 0
ENDIF

// ==========================================
// Historical Lines & V-Lines
// ==========================================

// Filter historical Open Horizontal Lines
DrawAllowed = (HistLines = 1) OR (HistLines = 0 AND Date = Today)

// 1. Asia Open
IF AsiaActive = 1 AND Asia = 1 AND DrawAllowed THEN
DRAWSEGMENT(StartBarAsia, AsiaOpen, barindex, AsiaOpen) COLOURED(0, 0, 0) STYLE(dottedline, 2)
ENDIF

// 2. London Open (Includes V-Line)
IF LondonActive = 1 AND London = 1 AND DrawAllowed THEN
DRAWSEGMENT(StartBarLondon, LondonOpen, barindex, LondonOpen) COLOURED(0, 0, 0) STYLE(line, 5)
Endif

// Vertical line
IF opentime = LondonStart AND London = 1 AND VertLine = 1 THEN
DRAWVLINE(barindex) COLOURED(0, 0, 0, 255) STYLE(dottedline, 3)
ENDIF

// 3. New York Open (Includes V-Line)
IF NYActive = 1 AND NYAM = 1 AND DrawAllowed THEN
DRAWSEGMENT(StartBarNY, NYOpen, barindex, NYOpen) COLOURED(0, 0, 255) STYLE(line, 5)
endif

// Vertical line
IF opentime = NYStart AND NYAM = 1 AND VertLine = 1 THEN
DRAWVLINE(barindex) COLOURED(0, 0, 255, 255) STYLE(dottedline, 3)
ENDIF

// 4. NY PM (Includes V-Line)
IF NYPM = 1 AND NYPMActive = 1 AND DrawAllowed THEN
DRAWSEGMENT(StartBarNYPM, NYPMOpen, barindex, NYPMOpen) COLOURED(0, 0, 0) STYLE(line, 4)
endif

// Vertical line
IF Time = NYPMStart AND NYPM = 1 AND NYPMActive = 1 AND VertLine = 1 THEN
DRAWVLINE(barindex) COLOURED(0, 0, 0, 255) STYLE(dottedline, 3)
ENDIF

// 5. 10am Open - No vertical Line
IF TenAM = 1 AND TenAMActive = 1 AND Time >= TenAMStart AND Time <= TenAMFinish AND DrawAllowed THEN
DRAWSEGMENT(StartBarTenAM, TenAMOpen, barindex, TenAMOpen) COLOURED(0, 0, 255, 255) STYLE(line, 5)
ENDIF

// 6. Midnight Open
IF Midnight = 1 AND DrawAllowed AND MidnightActive = 1 AND Time >= MidnightStart AND Time <= MidnightFinish THEN
DRAWSEGMENT(StartBarMidnight, MidnightOpen, barindex, MidnightOpen) COLOURED(255, 192, 64, 255) STYLE(line, 5)
ENDIF

// ==========================================
// TEXT LABELS ENGINE (On Far Right !)
// ==========================================
IF Text = 1 AND ISLASTBARUPDATE then //AND DrawAllowed THEN

// 1. Asia Open Label
IF AsiaActive = 1 AND Asia = 1 THEN
DRAWTEXT("AsOp", barindex + Dist, AsiaOpen, Dialog, Standard, 11) COLOURED(0, 0, 0)
ENDIF

// 2. London Open Label
IF LondonActive = 1 AND London = 1 THEN
DRAWTEXT("LonOp", barindex + Dist, LondonOpen, Dialog, Standard, 11) COLOURED(0, 0, 0)
ENDIF

// 3. New York Open Label
IF NYActive = 1 AND NYAM = 1 THEN
DRAWTEXT("NYOp", barindex + Dist, NYOpen, Dialog, Standard, 11) COLOURED(0, 0, 255)
ENDIF

// 4. NY PM Open Label
IF NYPM = 1 AND NYPMActive = 1 THEN
DRAWTEXT("NYpmOp", barindex + Dist, NYPMOpen, Dialog, Standard, 11) COLOURED(0, 0, 0)
ENDIF

// 5. 10AM Open Label
IF TenAM = 1 AND TenAMActive = 1 AND Time >= TenAMStart AND Time <= TenAMFinish THEN
DRAWTEXT("10amOp", barindex + Dist, TenAMOpen, Dialog, Standard, 11) COLOURED(0, 0, 255)
ENDIF

// 6. Midnight Open Label
IF Midnight = 1 AND MidnightActive = 1 AND Time >= MidnightStart AND Time <= MidnightFinish THEN
DRAWTEXT("MidnOp", barindex + Dist, MidnightOpen, Dialog, Standard, 11) COLOURED(255, 192, 64)
ENDIF

ENDIF

RETURN

Download
Filename: ICT-Session-Open-Lines.itf
Downloads: 15
nicko
nicko Senior
Operating in the shadows, I hack problems one by one. My bio is currently encrypted by a complex algorithm. Decryption underway...
Author’s Profile

Comments

ProRealCode ProRealCode
Loading...