Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Can someone convert this TOS Indicator to code for Ninjatrader

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Can someone convert this TOS Indicator to code for Ninjatrader

    Need help converting this code to NInjatrader.. plan to use this in strategy... or can this be converted to indicator as well...


    input length = 20;
    input momentum = 5;

    assert(momentum > 0, "'momentum' must be positive: " + momentum);

    def emaInc = ExpAverage(Max(close - close[momentum], 0), length);
    def emaDec = ExpAverage(Max(close[momentum] - close, 0), length);
    plot RMI = if emaDec == 0 then 0 else 100 - 100 / (1 + emaInc / emaDec);
    plot OverBought = 70;
    plot OverSold = 30;

    RMI.SetDefaultColor(GetColor(1));
    OverBought.SetDefaultColor(GetColor(8));
    OverSold.SetDefaultColor(GetColor(8));​

    #2
    HI vrajneesh, thanks for posting. Unfortunately, the support team can not convert custom code, another forum member must volunteer for that.

    We have the EMA in NinjaTrader by default:



    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    10 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    14 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    11 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Yesterday, 07:51 PM
    0 responses
    14 views
    0 likes
    Last Post strategist007  
    Started by StockTrader88, 03-06-2021, 08:58 AM
    44 responses
    3,983 views
    3 likes
    Last Post jhudas88  
    Working...
    X