I need help conveting a TOS script to Ninjatrade code. Does anyone can help me to do it, please?. Thank you!
Below, I posted the TOS script for StochRSI indicator.
declare lower;
input RSI_length = 14;
input over_bought = 80;
input over_sold = 20;
input RSI_choice = {default "RSI Wilder", "RSI EMA"};
input RSI_price = close;
input KPeriod = 14;
input DPeriod = 3;
input slowing_period = 1;
input smoothingType = {Default SMA, EMA};
def RSI;
switch (rsi_choice) {
case "RSI EMA":
RSI = RSI_EMA(price = RSI_price, length = RSI_length);
case "RSI Wilder":
RSI = RSIWilder(price = RSI_price, length = RSI_length);
}
plot FullK = StochasticFull(over_bought, over_sold, KPeriod, DPeriod, RSI, RSI, RSI, slowing_period, smoothingType).FullK;
plot FullD = StochasticFull(over_bought, over_sold, KPeriod, DPeriod, RSI, RSI, RSI, slowing_period, smoothingType).FullD;
plot OverBought = over_bought;
plot OverSold = over_sold;
FullK.SetDefaultColor(GetColor(5));
FullD.SetDefaultColor(GetColor(0));
OverBought.SetDefaultColor(GetColor(1));
OverSold.SetDefaultColor(GetColor(1));
Comment