I'm trying to accomplish the following:
a) I have a strategy based on DAILY bars
b) I want to enter and order only from 3.30pm EST to 4:00pm EST
I tried the code below but I get no orders in my backtesting.
Any ideas?
Thanks!
Tex
================================================
Initialize
Add(PeriodType.Minute, 1);
CalculateOnBarClose = true;
protectedoverridevoid OnBarUpdate()
{
if (BarsInProgress == 0)
if whateverstrategyIuse = True
{
if ((ToTime(Time[0]) >= 153000 && ToTime(Time[0]) < 160000))
{
EnterShort(1,1,"Short");
}
}
// When the OnBarUpdate() is called from the secondary bar series, do nothing.
else
{
return;
}
}

Comment