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

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)
    Paul H.NinjaTrader Customer Service

    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 GussJ, 03-04-2020, 03:11 PM
        16 responses
        3,279 views
        0 likes
        Last Post Leafcutter  
        Started by WHICKED, Today, 12:45 PM
        2 responses
        19 views
        0 likes
        Last Post WHICKED
        by WHICKED
         
        Started by Tim-c, Today, 02:10 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Taddypole, Today, 02:47 PM
        0 responses
        5 views
        0 likes
        Last Post Taddypole  
        Started by chbruno, 04-24-2024, 04:10 PM
        4 responses
        51 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Working...
        X