Announcement

Collapse
No announcement yet.

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:



    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    156 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    90 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    139 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    130 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    107 views
    0 likes
    Last Post CarlTrading  
    Working...
    X