I tried to add an exponential smoothing to the default Ninja Indicator DM, Here is What I did,
I replaced the following code:
if (CurrentBar < Period) { sumTr.Set(sumTr[1] + tr[0]); sumDmPlus.Set(sumDmPlus[1] + dmPlus[0]); sumDmMinus.Set(sumDmMinus[1] + dmMinus[0]); } else { sumTr.Set(sumTr[1] - sumTr[1] / Period + tr[0]); sumDmPlus.Set(sumDmPlus[1] - sumDmPlus[1] / Period + dmPlus[0]); sumDmMinus.Set(sumDmMinus[1] - sumDmMinus[1] / Period + dmMinus[0]); }
sumTr =[COLOR="Red"]Value[/COLOR][1]+(1/14)*(tr[0]-Value[1]); sumDmPlus =[COLOR="red"]Value[/COLOR][1]+(1/14)*(dmPlus[0]-Value[1]); sumDmMinus=[COLOR="red"]Value[/COLOR][1]+(1/14)*(dmMinus[0]-Value[1]);
but the compiler show the errors(shown in red) as :
Cannot implicitly convert type 'double' to 'NinjaTrader.Data.DataSeries' (NT0029).
Anyone knows why is this happening ?
Thank you !
Wolfcuring
Comment