I want to have SMA(30) of Daily Body size. To achieve that, I first created additional series:
if (BarsInProgress == 7) // Daily { BODY0D[0] = Math.Abs(Close[0] - Open[0]); BODY30D = SMA(BODY0D, 30)[0]; }
I tried to change code to: BODY0D[0] = Math.Abs(Closes[7] - Opens[7]);, but it does give error: "Operator '-' cannot be applied to operands of type 'NinjaTrader.NinjaScript.PriceSeries' and 'NinjaTrader.NinjaScript.PriceSeries'"
I also get the same error, if I try to change code of BODY30D to BODY30D = SMA(Closes[7] - Opens[7], 30)[0];
So how can I get SMA(30) Of Daily Body working properly with 900 Tick as primary series?
Comment