Hi all, I am currently backtesting a strategy to see between which hours of the day are the best to run it. At the moment all I can do is test it manually for different time intervals using DEFPARAM FLATBEFORE and DEFPARAM FLATAFTER but this is taking extremely long to go through everything.
Does anyone know of a way to optimise for different hours of the day?
Thanks in advance!
EricParticipant
Master
Have you tried setting variables for the timeframes not even sure if it works would have to test it out.
DEFPARAM FLATBEFORE = a
DEFPARAM FLATAFTER = b
starting point a 08000 end point a 23000 interval 1000
do same with b.
Not even sure this works just a theory
MazParticipant
Veteran
@StantonR Yes, that works, I do that – t not using flatbefore and flatafter but by using:
tradingTime = time > startTime and time < endTime
if tradingTime then
...
else
...
endif
Thanks for the response, Yeah I was thinking that too, the only issue is is optimising within those hours, since there are only 60 minutes within an hour but the optimisation will iterate through until the next thousand
Ive done it before using, for example, 080000 to 130000 with interval 001500 (15 mins) but ignore results for those times that don’t make sense, e.g. 0975000.
Hope that makes sense 🙂
GraHal