Announcement

Collapse
No announcement yet.

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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        68 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        36 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        61 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        62 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        53 views
        0 likes
        Last Post CarlTrading  
        Working...
        X