I was going to suggest this code to test against before making a trade:
ValidTime = not ((time = 000000) or (time = 200000))
But to my surprise I can’t get it to work as still takes some positions at 20:00. Either a bug in the system or a bug in my thinking.
@Nicholas can you take a look please
Using a 4 hour chart on a forex pair using the code below it still takes some positions at 200000 (see attached screenshot) even though the TimeCount graph output is 0? Only does this for 200000 not any of the other times.
defparam CUMULATEORDERS = true
once TimeCount = 0
if not (time = 200000) then
Buy 1 contract at market
if time = 200000 then
TimeCount = TimeCount + 1
endif
endif
graph TimeCount