I am trying to convert a TradingView indicator into NinjaScript so I can use it in a NinjaTrader strategy, this is the indicator https://www.tradingview.com/script/h...o-OPEN-SOURCE/.
I am having trouble converting this particular section of code...
math.sum(avpch * avpch, blength)
math.sum is not available to use in NinjaScript therefore I think the NinjaScript conversion of this code is
SUM(avpch * avpch, blength)[0]
I am bringing in the ALMA indicator values by inserting this into (State == State.DataLoaded)
ALMA1 = ALMA(Close);
double avpch = ALMA1[0];
- The best overloaded method match for 'NinjaTrader.NinjaScript.Indicators.Indicator.SUM( NinjaTrader.NinjaScript.ISeries<double>, int)' has some invalid arguments; and
- Argument 1: cannot convert from 'double' to 'NinjaTrader.NinjaScript.ISeries<double>'
Thanks in advance.
Neil

Comment