@toniyecla

Global Trading Sessions Overlay Indicator

Category: Indicators By: @toniyecla Created: October 9, 2024, 3:34 PM
October 9, 2024, 3:34 PM
Indicators
6 Comments
Global Trading Sessions Overlay Indicator

Global Trading Sessions Overlay

Introduction

The Global Trading Sessions Overlay indicator is designed to help traders visualize the active trading hours of the major financial markets: Asia, Europe, and the USA. By displaying the opening, closing, and lunch break periods of these key markets, the indicator enhances the trader’s ability to monitor market dynamics based on time zones. This tool is particularly useful for identifying high-volume periods and overlaps between major sessions, where liquidity is often at its peak.

Indicator Description

This indicator highlights the different trading sessions—Asia (Tokyo), Europe, and the USA—directly on the price chart. It also provides visual markers for the lunch breaks in each market, and the overlaps between European and US sessions.

By using different background colors, the trader can quickly identify the active market at any given time:

  • Black for the Asian session.
  • Green for the European session.
  • Blue for the American session.

Moreover, during periods of overlap between the US and European markets, a distinct blue-green overlay will appear, indicating higher potential trading activity.

Configuration

The Global Trading Sessions Overlay indicator provides several customizable options to tailor it to your specific needs:

  • EspHorarioVerano: A Boolean setting that determines whether to account for daylight savings time in Spain. This ensures the Asian and European sessions start and end at the correct times.
  • NYHorarioVerano: Similar to the Spanish daylight savings option, this Boolean flag adjusts the US session based on whether New York is observing daylight savings.
  • LuchTime: This option controls whether or not to highlight the lunch breaks in the Asian, European, and US sessions. Lunch breaks are generally periods of lower trading activity and are shown with a lower-opacity background color.
  • Opacidad: This variable adjusts the transparency of the background colors for each session, making it easier to blend the indicator with your existing chart setup. A higher value increases the opacity, while a lower value makes the background more transparent.

Colors and Visual Markers

Each trading session is marked by a specific color, providing a quick and clear visual cue for traders:

  • Asian Session (Tokyo): Displayed in black with varying opacity levels to distinguish between normal trading hours and lunch breaks. The session starts at 01:00 or 02:00 depending on the Spanish daylight savings setting, and lunch is indicated by a lighter shade of black.
  • European Session: The European trading hours are shown with a green background, starting at 09:00 and ending at 17:30. A brief lunch period, if enabled, is represented by a lighter green color from 13:00 to 13:02.
  • US Session: The US session is represented by a blue background. Depending on the daylight savings settings for New York, the session starts at either 14:30 or 15:30, with a lunch break in lighter blue from 16:45 to 18:30 or 17:45 to 19:30.
  • Overlap between European and US Sessions: When the US and European sessions overlap, a blue-green background appears, marking this period as a highly active time for trading.

Conclusion

The Global Trading Sessions Overlay is a powerful tool for traders who want to stay aware of market activity across different time zones. By clearly marking the key trading sessions and lunch breaks, this indicator makes it easier to plan trades during times of peak liquidity and volume. The customizable options provide flexibility to adjust the visuals according to personal preferences, and the session overlap highlight is particularly helpful for identifying high-activity periods.

// Author: toniyecla - contact@rescommunesomnium.com
// Sesiones v2

DEFPARAM DrawOnLastBarOnly = True
ONCE opacidad = 1

EspHorarioVerano=0
NYHorarioVerano=0
LuchTime=1

// ASIA (solo Tokio)

if EspHorarioVerano then
ONCE AsianStart       = 020000
ONCE AsianEnd         = 080000
ONCE AsianLunchStart  = 043000
ONCE AsianLunchEnd    = 053000
else
ONCE AsianStart       = 010000
ONCE AsianEnd         = 070000
ONCE AsianLunchStart  = 033000
ONCE AsianLunchEnd    = 043000
endif

if time > AsianStart and time <= AsianEnd then
backgroundcolor(0, 0, 0, 16 * opacidad)
endif

if LuchTime then
if time > AsianLunchStart and time <= AsianLunchEnd then
backgroundcolor(0, 0, 0, 8 * opacidad)
endif
endif

// EUROPE

ONCE EuropeStart      = 090000
ONCE EuropeEnd        = 173000
ONCE EuropeLunchStart = 130000
ONCE EuropeLunchEnd   = 143000

if (time > EuropeStart and time <= EuropeEnd) then
backgroundcolor(0, 64, 0, 24 * opacidad)
endif

if (LuchTime) then
if time > EuropeLunchStart and time <= EuropeLunchEnd then
backgroundcolor(0, 64, 0, 8 * opacidad)
endif
endif

// USA

if (EspHorarioVerano = NYHorarioVerano) then
ONCE USAStart         = 153000
ONCE USAEnd           = 220000
ONCE USALunchStart    = 174500
ONCE USALunchEnd      = 193000
else
ONCE USAStart         = 143000
ONCE USAEnd           = 210000
ONCE USALunchStart    = 164500
ONCE USALunchEnd      = 183000
endif

if (time > USAStart and time <= USAEnd) then
backgroundcolor(0, 0, 64, 32 * opacidad)
endif

// horario estimado NYSE no hace pausa oficial para comer
if (LuchTime) then
if time > USALunchStart and time <= USALunchEnd then
backgroundcolor(0, 0, 64, 16 * opacidad)
endif
endif

// OVERLAPS

if time > USAStart and time <= EuropeEnd then
backgroundcolor(0, 48, 64, 32 * opacidad)
endif

RETURN

Download
Filename: Sesiones-v2-1-1.itf
Downloads: 172
@toniyecla
@toniyecla Junior
This author is like an anonymous function, present but not directly identifiable. More details on this code architect as soon as they exit 'incognito' mode.
Author’s Profile

Comments

Schizophunk
1 year ago
#

Hola Toni, Muchas gracias por el indicador. Estos dias he estado utilizandolo y me ha surgido una duda. Suponiendo que utilizamos el indicador en España. Tenemos dos horarios: invierno UTC+1, verano UTC+2. Esto afeca a los horarios de Asia (desde Marzo a Octubre), y a los horarios de New York (varias semanas en Marzo y 1 semana en Octubre-noviembre). Tiene esto en cuenta el indicador? ProRealTime hace estos ajustes automaticamente al estar configurado en zona horaria Madrid?

@toniyecla
2 years ago
#

// Author: toniyecla - contact@rescommunesomnium.com // VARIABLES // EspHorarioVerano (boolean) false // NYHorarioVerano (boolean) false // LunchTime (boolean) true // AsianMaxMin (boolean) false // EuropeMaxMin (boolean) false // USAMaxMin (boolean) false // DEFPARAM DrawOnLastBarOnly = True ONCE opacidad = 1 // ASIA (solo Tokio) if EspHorarioVerano then ONCE AsianStart = 020000 ONCE AsianEnd = 080000 ONCE AsianLunchStart = 043000 ONCE AsianLunchEnd = 053000 else ONCE AsianStart = 010000 ONCE AsianEnd = 070000 ONCE AsianLunchStart = 033000 ONCE AsianLunchEnd = 043000 endif ONCE AsianSession = 0 ONCE AsianHigh = 0 ONCE AsianLow = 999999 ONCE AsianBarindex = 999999 if time > AsianStart and time <= AsianEnd then AsianSession = 1 AsianHigh = max(AsianHigh, high) AsianLow = min(AsianLow, low) AsianBarindex = min(AsianBarindex, barindex[1]) backgroundcolor(0, 0, 0, 16 * opacidad) endif if LunchTime then if time > AsianLunchStart and time <= AsianLunchEnd then backgroundcolor(0, 0, 0, 8 * opacidad) endif endif if AsianMaxMin and time > AsianEnd and AsianSession = 1 then drawsegment(AsianBarindex, AsianHigh, barindex, AsianHigh) coloured(0, 0, 0, 64) drawsegment(AsianBarindex, AsianLow, barindex, AsianLow) coloured(0, 0, 0, 64) pos = (barindex-AsianBarindex)/2 if pos > 0 then drawtext("ASIAN SESSION", barindex[round(pos)], AsianHigh+16, Dialog, Standard, 8) coloured(0, 0, 0, 128) endif AsianSession = 0 AsianHigh = 0 AsianLow = 999999 AsianBarindex = 999999 endif // EUROPE ONCE EuropeStart = 090000 ONCE EuropeEnd = 173000 ONCE EuropeLunchStart = 130000 ONCE EuropeLunchEnd = 130200 ONCE EuropeSession = 0 ONCE EuropeHigh = 0 ONCE EuropeLow = 999999 ONCE EuropeBarindex = 999999 if (time > EuropeStart and time <= EuropeEnd) then EuropeSession = 1 EuropeHigh = max(EuropeHigh, high) EuropeLow = min(EuropeLow, low) EuropeBarindex = min(EuropeBarindex, barindex[1]) backgroundcolor(0, 64, 0, 24 * opacidad) endif if (LunchTime) then if time > EuropeLunchStart and time <= EuropeLunchEnd then backgroundcolor(0, 64, 0, 16 * opacidad) endif endif if EuropeMaxMin and time > EuropeEnd and EuropeSession = 1 then drawsegment(EuropeBarindex, EuropeHigh, barindex, EuropeHigh) coloured(0, 0, 0, 64) drawsegment(EuropeBarindex, EuropeLow, barindex, EuropeLow) coloured(0, 0, 0, 64) pos = (barindex-EuropeBarindex)/2 if pos > 0 then drawtext("EUROPE SESSION", barindex[round(pos)], EuropeHigh+16, Dialog, Standard, 8) coloured(0, 0, 0, 128) endif EuropeSession = 0 EuropeHigh = 0 EuropeLow = 999999 EuropeBarindex = 999999 endif // USA if (EspHorarioVerano = NYHorarioVerano) then ONCE USAStart = 153000 ONCE USAEnd = 220000 ONCE USALunchStart = 174500 ONCE USALunchEnd = 193000 else ONCE USAStart = 143000 ONCE USAEnd = 210000 ONCE USALunchStart = 164500 ONCE USALunchEnd = 183000 endif ONCE USASession = 0 ONCE USAHigh = 0 ONCE USALow = 999999 ONCE USABarindex = 999999 if (time > USAStart and time <= USAEnd) then USASession = 1 USAHigh = max(USAHigh, high) USALow = min(USALow, low) USABarindex = min(USABarindex, barindex[1]) backgroundcolor(0, 0, 64, 32 * opacidad) endif // horario estimado NYSE no hace pausa oficial para comer if (LunchTime) then if time > USALunchStart and time <= USALunchEnd then backgroundcolor(0, 0, 64, 16 * opacidad) endif endif if USAMaxMin and time > USAEnd and USASession = 1 then drawsegment(USABarindex, USAHigh, barindex, USAHigh) coloured(0, 0, 0, 64) drawsegment(USABarindex, USALow, barindex, USALow) coloured(0, 0, 0, 64) pos = (barindex-USABarindex)/2 if pos > 0 then drawtext("USA SESSION", barindex[round(pos)], USAHigh+16, Dialog, Standard, 8) coloured(0, 0, 0, 128) endif USASession = 0 USAHigh = 0 USALow = 999999 USABarindex = 999999 endif // OVERLAPS if time > USAStart and time <= EuropeEnd then backgroundcolor(0, 48, 64, 32 * opacidad) endif RETURN

@toniyecla
2 years ago
#

y más opciones: añade una línea también en sesiones EUROPA y USA (configurable) y un texto o leyenda:

@toniyecla
2 years ago
#

captura: https://www.prorealcode.com/wp-content/uploads/2024/10/sesiones_v3.png

@toniyecla
2 years ago
#

Una pequeña actualización: esta tercera versión marca el HIGH y el LOW de la sesión de ASIA con una línea // Author: toniyecla - contact@rescommunesomnium.com // VARIABLES A AÑADIR // EspHorarioVerano (boolean) false // NYHorarioVerano (boolean) false // LunchTime (boolean) true // AsianMaxMin (boolean) false // DEFPARAM DrawOnLastBarOnly = True ONCE opacidad = 1 // ASIA (solo Tokio) if EspHorarioVerano then ONCE AsianStart = 020000 ONCE AsianEnd = 080000 ONCE AsianLunchStart = 043000 ONCE AsianLunchEnd = 053000 else ONCE AsianStart = 010000 ONCE AsianEnd = 070000 ONCE AsianLunchStart = 033000 ONCE AsianLunchEnd = 043000 endif ONCE AsianSession = 0 ONCE AsianHigh = 0 ONCE AsianLow = 999999 ONCE AsianBarindex = 999999 if time > AsianStart and time <= AsianEnd then AsianSession = 1 AsianHigh = max(AsianHigh, high) AsianLow = min(AsianLow, low) AsianBarindex = min(AsianBarindex, barindex[1]) backgroundcolor(0, 0, 0, 16 * opacidad) endif if LunchTime then if time > AsianLunchStart and time <= AsianLunchEnd then backgroundcolor(0, 0, 0, 8 * opacidad) endif endif if AsianMaxMin and time > AsianEnd and AsianSession = 1 then drawsegment(AsianBarindex, AsianHigh, barindex, AsianHigh) coloured(0, 0, 0, 64) drawsegment(AsianBarindex, AsianLow, barindex, AsianLow) coloured(0, 0, 0, 64) AsianSession = 0 AsianHigh = 0 AsianLow = 999999 AsianBarindex = 999999 endif // EUROPE ONCE EuropeStart = 090000 ONCE EuropeEnd = 173000 ONCE EuropeLunchStart = 130000 ONCE EuropeLunchEnd = 130200 if (time > EuropeStart and time <= EuropeEnd) then backgroundcolor(0, 64, 0, 24 * opacidad) endif if (LunchTime) then if time > EuropeLunchStart and time <= EuropeLunchEnd then backgroundcolor(0, 64, 0, 16 * opacidad) endif endif // USA if (EspHorarioVerano = NYHorarioVerano) then ONCE USAStart = 153000 ONCE USAEnd = 220000 ONCE USALunchStart = 174500 ONCE USALunchEnd = 193000 else ONCE USAStart = 143000 ONCE USAEnd = 210000 ONCE USALunchStart = 164500 ONCE USALunchEnd = 183000 endif if (time > USAStart and time <= USAEnd) then backgroundcolor(0, 0, 64, 32 * opacidad) endif // horario estimado NYSE no hace pausa oficial para comer if (LunchTime) then if time > USALunchStart and time <= USALunchEnd then backgroundcolor(0, 0, 64, 16 * opacidad) endif endif // OVERLAPS if time > USAStart and time <= EuropeEnd then backgroundcolor(0, 48, 64, 32 * opacidad) endif RETURN

Alai-n
2 years ago
#

Thank you

ProRealCode ProRealCode
Loading...