I normally use this code to set an intraday windows for opening new orders in proorder:
noEntryBeforeTime = 091500
timeEnterBefore = time >= noEntryBeforeTime
noEntryAfterTime = 170000
timeEnterAfter = time < noEntryAfterTime
if my conditions
AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry then
buy 1 contract at market
But I wonder if is it possible to set two or more windows, for example one on London opening and one on NY opening.
Do you have solutions?
You can add as many as you wish, just add different variable names, such as
timeEnterBefore1 = time >= 091500
timeEnterAfter1 = time < 123000 //pause at lunchtime
timeEnterBefore2 = time >= 143000 //start again
timeEnterAfter2 = time < 170000
if my condition AND ((timeEnterBefore1 AND timeEnterAfter1) or (timeEnterBefore2 AND timeEnterAfter2)) AND not daysForbiddenEntry then
buy 1 contract at market
endif
Thanks, so simply after all!