Hello,
I would like to create a time window by defining times using the HHMMSS format and adding 4 seconds to it, something like:
OpenMarketTime= 143000
CloseMarketTime=210000
OpenMarketWindow= Time > OpenMarketTime AND Time < CloseMarketTime+5 <- intention is to extend the window by 5 seconds
This doesn’t seem to work, although I don’t get an error. Is there a way of getting this right?
Thanks for your help
Gary
It will work but you will have to trade on a 5 second or 1 second chart.
Something isn’t adding up unfortunately. The code doesn’t run on a 1 second chart. However if I change CloseMarketTime+5 to a specific time eg 210005 in the above code, it runs. (CloseMarketTime+5) doesn’t help either
It should work with either. The issue with trading on 1 second charts is that if there are no trades in that second then there is no candle to have that time so it does not recognise that the
time has occurred.
I understand thanks, but there are trades during the 5 second added time on the SPX500. Changing the time to a specific number 210005 finds many trades.
I tried this indicator on a 1-second TF:
OpenMarketTime= 143000
CloseMarketTime=210000
OpenMarketWindow= Time > OpenMarketTime AND Time < CloseMarketTime+5
return OpenMarketWindow
it seems to be working fine (pic refers to yesterday night).
Thanks for the help… I’ll dig deeper, but can’t get it to work strangely