Attached is a screenshot of the NinjaScript code for the current 5 minute price bar being above the current high/below the current day's low. And below is that code.
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if (CurrentBars[0] < 1
|| CurrentBars[1] < 1)
return;
// Set 1
if (Lows[1][0] >= CurrentDayOHL1.CurrentHigh[0])
{
EnterLong(Convert.ToInt32(DefaultQuantity), "");
}
// Set 2
if (Highs[1][0] <= CurrentDayOHL1.CurrentLow[0])
{
EnterShort(Convert.ToInt32(DefaultQuantity), "");
}
}
What NinjaScript code would be needed to then say that anywhere from 1 to 5 five minute bars need to form and close before my next condition statement?
Comment