Wilmington Delaware
Experience: Intermediate
Platform: NinjaTrader, TOS
Trading: Futures
Posts: 24 since May 2019
Thanks Given: 3
Thanks Received: 16
|
Hi,
I am hoping someone can convert the TOS RSI code over to NT8. For some reason the RSI on NinjaTrader 8 doesn't look the same as it does on TOS.
Here is the code I would like converted:
//Start of code
declare lower;
input length = 14;
input over_Bought = 90;
input over_Sold = 10;
input mid_line = 50;
input price = close;
input averageType = AverageType.SIMPLE;
def NetChgAvg = MovingAverage(averageType, price - price[1], length);
def TotChgAvg = MovingAverage(averageType, AbsValue(price - price[1]), length);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;
plot RSI = 50 * (ChgRatio + 1);
plot OverSold = over_Sold;
plot OverBought = over_Bought;
plot Midline = mid_line;
RSI.SetDefaultColor(GetColor(8));
OverSold.SetDefaultColor(GetColor(8));
OverBought.SetDefaultColor(GetColor(8));
Midline.SetDefaultColor(GetColor(8));
//End of code
Thanks.
|