NexusFi: Find Your Edge


Home Menu

 





Need TOS RSI Converted to NT8


Discussion in NinjaTrader

Updated
    1. trending_up 97 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 0 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 Joseph H 
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.

Started this thread Reply With Quote




Last Updated on December 13, 2024


© 2025 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Sitemap - Downloads - Top
no new posts