World trading session

Category: Indicators By: manual_ice Created: January 21, 2020, 2:25 PM
January 21, 2020, 2:25 PM
Indicators
2 Comments

Hello,

I just want to share my world trading session indicator. To keep price chart most clean as possible, this indicator is build to be added onto another chart just under price chart. It also display lunch time. It can work with many time frame, but M30, M15 or whatever less is better of course.

You just need to add “fill” in indicator properties for pretty display.

Have fun.

//--indicator name : aa_world_trading_session
//--author : prorealcode pseudo : manual_ice
//--version 1.0
//--PRT 10.3 or higher
once ONsize=0.8
once LunchSize=0.2

//--EURO market
once euroOpen=090000
once euroClos=173000
once euroLunchBegin=123000
once euroLunchEnd=130000
once euroOFF=2
euroON=euroOFF
cEuro= time>euroOpen and time<euroClos
if cEuro then
  cEuroLunch= time>euroLunchBegin and time<euroLunchEnd
  if cEuroLunch then
    euroON=euroON+LunchSize
  else
    euroON=euroON+ONsize
  endif
  if not cEuro[1] then //--start of session
    Drawtext("Euro",barindex+2,euroOFF+0.4)
  endif
endif

//--US market
once usOpen=143000 //08h30 US time
once usClos=220000 //16h00 us time
once usLunchBegin=174500  //--typically 11h45 - 13h30
once usLunchEnd=193000
once usOFF=1
usON=usOFF
cUs=time>usOpen and time<usClos
if cUs then
  cUsLunch=time>usLunchBegin and time<usLunchEnd
  if cUsLunch then
    usON=usON+LunchSize
  else
    usON=usON+ONsize
  endif
  if not cUs[1] then //--start of session
    Drawtext("Us",barindex+2,usOFF+0.4)
  endif
endif

//--Asia1 market
once asiaOpen=010000
once asiaClos=070000
once asiaLunchBegin=030000
once asiaLunchEnd=050000
once asiaOFF=0 //--default indicator level
asiaON=asiaOFF
cAsia=time>asiaOpen and time<asiaClos
if cAsia then
  cAsiaLunch=time>asiaLunchBegin and time<asiaLunchEnd
  if cAsiaLunch then
    asiaON=asiaON+LunchSize
  else
   asiaON=asiaON+ONsize
  endif
  if not cAsia[1] then //--start of session
    Drawtext("Asia",barindex+2,asiaOFF+0.4)
  endif
endif

//-- with indicator "properties", add coloured fill between euroOFF and euroON, between usOFF and usON, and between asiaOFF and asiaON
return euroON as "Euro ON", euroOFF as "Euro OFF", usON as "Us ON", usOFF as "Us OFF", asiaON as "Asia ON", asiaOFF as "Asia OFF"

Download
Filename: aa_world_trading_session.itf
Downloads: 189
manual_ice Junior
As an architect of digital worlds, my own description remains a mystery. Think of me as an undeclared variable, existing somewhere in the code.
Author’s Profile

Comments

Logo Logo
Loading...