I'm trying to build an opening range breakout strategy.
My strategy orders a short position when the current price is lower than the currentDayOpen - (previous day true range) * 0.5.
However, as you can see in the picture below, the order is in the next day instead of triggering at the right price (pointed by the arrow)
I use 1 second data series as a secondary data.
currentOpen = CurrentDayOHL().CurrentOpen[0];
priorClose = PriorDayOHLC().PriorClose[0];
if (Position.MarketPosition == MarketPosition.Flat)
{
if (condition && (Close[0] > currentOpen + trueRange1 * 0.5) && priorClose > fiftyDaysAgoClose)
{
EnterLong(1, 1, "MyEntryLong");
}
else if (condition && (Close[0] < currentOpen - trueRange1 * 0.5))
{
Print("Time: " + Time[0] + " Current: " + Close[0]+ " Open: " + Opens[0][0] + " trigger: " + (currentOpen - trueRange1 * 0.5));
EnterShort(1, 1, "MyEntryShort");
}
}

Comment