Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with creating condition for DM.DiPlus Slope

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

    Help with creating condition for DM.DiPlus Slope

    Hello,

    My goal is to get the slope of the DM.DiPlus (on the DM indicator) and also the DM.DiMinus slope.

    I am trying to create a condition where if the DM.DiPlus slope is positive (> 0)

    and the DM.DiMinus slope is negative.

    I attempted to code it on my own as I thought it would be simple since the slope reference seemed easy.

    I attempted a few ways but each time the system would flash errors.

    I currently have the DMI Close, 14 set already.

    And I attempted to code the following in OnBarUpdate:

    if (Slope(DM.DiPlus), 0, 3) > 0)
    {
    // condition goes here
    }

    I believe this to be correct but it gives me errors. Am i using the Slope script correctly?

    TIA

    #2
    Hello dorony,

    Thanks for your post.

    It looks like your syntax is incorrect, there is an extra ")".

    Try: if (Slope(DM.DiPlus, 0, 3) > 0)

    Comment


      #3
      Thank you will try it out.

      Am i correct in thinking that anything greater than 0 is sloping up and anything less than 0 is sloping down?

      Comment


        #4
        Hello dorony,

        Yes, that would be correct. See Tips at the following link,


        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        558 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        324 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        545 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        547 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X