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 ageeholdings, Today, 07:43 AM
    0 responses
    10 views
    0 likes
    Last Post ageeholdings  
    Started by pibrew, Today, 06:37 AM
    0 responses
    4 views
    0 likes
    Last Post pibrew
    by pibrew
     
    Started by rbeckmann05, Yesterday, 06:48 PM
    1 response
    14 views
    0 likes
    Last Post bltdavid  
    Started by llanqui, Today, 03:53 AM
    0 responses
    9 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    12 views
    0 likes
    Last Post burtoninlondon  
    Working...
    X