Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with converting code

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

    Help with converting code

    Hi How do I do this is Ninja Trader XAverage(Close,MAFast) - XAverage(Close,MASlow) > MAD, is just subtracting two moving averages this is tradestation code

    Thank You

    RM

    #2
    Hello RMin101,

    I went ahead and moved this to a new thread, in the future please ensure to ask new questions you have as new threads instead of replying to older posts.

    To do what you are asking you can essentially use the code you have shown, you just need to use indicators that you have in NinjaTrader. I am not sure what XAverage is, if that is similar to a moving average you could use a SMA or EMA:

    Code:
    double subtractedValue = SMA(MAFast)[0] - SMA(MASlow)[0];
    
    if(subtractedValue > MAD)
    MAD would need to be some kind of double variable, that could be a user input, variable or other indicator.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    23 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    186 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    345 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    267 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X