You actually have this condition so you are alredy executing on the primary series:
if (BarsInProgress != 0) return;
protected override void OnBarUpdate()
{
if (CurrentBars[0] < 1
|| CurrentBars[1] < 0)
return;
if(BarsInProgress == 0)
{
// Set 1
if (
// Condition group 1
&& (DM1.ADXPlot[0] > DM1.ADXPlot[1])
&& (DM1.DiPlus[0] > DM1.DiMinus[0])
&& (DM1.ADXPlot[0] >= Adxl)
&& (DM2.ADXPlot[0] >= Adx4))
{
}
if(BarsInProgress == 1) { DM2 = DM(14); }
}

Comment