Before I start modifying my strats I have a question about the start and end time of strategies.
At the moment I use this construction:
if ((ToTime(Time[0]) >= t1start && ToTime(Time[0]) < t1eind)
|| (ToTime(Time[0]) >= t2start && ToTime(Time[0]) < t2eind)
)
{do something;}
else
{do something else;}
When I use this on my (30 min and 60 min) charts, I always have the problem that the 30 min strategy starts at an half hour (for example 10.00 or 10.30) and the 60 min charts start at the full hour (f.e. 10.00 or 11.00). Even with
CalculateOnBarClose=false.
But I want certain strategies to start at lets say 10.05, 10.25 or 10.35. So exactly at a certain minute.
Should I make the construction with DateTime.Now.Hour+DateTime.Now.Minute?
My question is: How can I do this the best way?
Comment