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

Price distance from EMA

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

    Price distance from EMA

    Hi,
    How do you set a ninjascript condition that says that a price is more than 90 cents away from an EMA?

    Thanks,

    Andrew

    #2
    Hi Andrew,

    You could use something like this, that takes absolute value of the difference:
    if (Math.Abs(Close[0] - EMA(14)[0]) > .9)
    {

    }
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hi Ryan,

      Is it possible to do so without coding?

      Comment


        #4
        Yes you can play with the offset field of the strategy wizard to add or subtract values. See the following link then the section: How to offset an item value


        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ETFVoyageur, Today, 10:34 AM
        7 responses
        18 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by KNalley, 01-24-2020, 10:33 AM
        10 responses
        965 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by Skifree, Today, 11:47 AM
        3 responses
        12 views
        0 likes
        Last Post Skifree
        by Skifree
         
        Started by molecool, Today, 01:48 PM
        0 responses
        3 views
        0 likes
        Last Post molecool  
        Started by ETFVoyageur, Today, 12:26 PM
        2 responses
        8 views
        0 likes
        Last Post ETFVoyageur  
        Working...
        X