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 Rapine Heihei, 04-23-2024, 07:51 PM
    2 responses
    30 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by Shansen, 08-30-2019, 10:18 PM
    24 responses
    942 views
    0 likes
    Last Post spwizard  
    Started by Max238, Today, 01:28 AM
    0 responses
    9 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by rocketman7, Today, 01:00 AM
    0 responses
    4 views
    0 likes
    Last Post rocketman7  
    Started by wzgy0920, 04-20-2024, 06:09 PM
    2 responses
    28 views
    0 likes
    Last Post wzgy0920  
    Working...
    X