I'm a new NinjaTrader user and am trying to convert some indicators I wrote using EasyLanguage in Tradestation into NT. I've been successful at a few, but this one, I cannot figure out. I have no experience in C#, just read the help files on NT website. It seems to not be possible to reference previous bar values of the double type variable, which I was able to do in TS.
If anyone can help me with the ninjascript code for the following, I would greatly appreciate it.
========================================
Inputs: Price(Close), Length(14), Displace(0), ROCAve1(4), ROCAve2(6);
Value1 = LinearRegValueFC(Price, Length, 0);
Value2 = Value1[0] - Value1[1];
Value3 = XAverage(Value2, ROCAve1);
Value4 = Value3[0] - Value3[1];
Value5 = XAverage(Value2, ROCAve2);
Value6 = Value5[0] - Value5[1];
Plot1(Value2, "LinRegROC");
Plot2(Value3, "LRegROCAve1");
Plot3(Value5, "LRegROCAve2");
Plot4(0, "Zero");
Comment