But it does not seem to be working.
I added a debug alert to see what value of R1 is coming up on OnBarUpdate. Everytime it seems to be zero.
Pls see if this works better for you.
Any help will be appreciated.
protected override void OnBarUpdate()
{
// Condition set 1
double R1val=MyPivots(PivotRange.Daily, HLCCalculationMode.CalcFromIntradayData, 0, 0, 0, 20).R1.Get(0);
if(R1val>0){
Alert("myBandAlert", NinjaTrader.Cbi.Priority.High, "Nonzero R1"+R1val,
"Alert2.wav", 10, Color.Black, Color.Red);
}
if (CrossAbove(MyPivots(PivotRange.Daily, HLCCalculationMode.CalcFromIntradayData, 0, 0, 0, 20).R1, Close, 1))
{
EnterLongStopLimit(DefaultQuantity, 0, 0, "");
}
}

Comment