Based on this thread
I am using this code
if(StartTime<StopTime && ToTime(Time[0]) >= (StartTime * 100) && ToTime(Time[0]) <= (StopTime * 100)) trade=true; else if (StartTime>StopTime) { if ((ToTime(Time[0]) >= (StartTime*100) && ToTime(Time[0]) <= 235959) || ToTime(Time[0]) < (StopTime * 100)) trade=true; } else trade=false;
StartTime = 1500; StopTime = 1230;
So the strategy crosses over sessions.
It seemed like it worked, but it is not working anymore. This has been a real headache, is there a simpler way to code this?
Comment