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 XXtrader, Today, 11:30 PM
        0 responses
        1 view
        0 likes
        Last Post XXtrader  
        Started by MarianApalaghiei, Today, 10:49 PM
        2 responses
        8 views
        0 likes
        Last Post MarianApalaghiei  
        Started by love2code2trade, Yesterday, 01:45 PM
        4 responses
        28 views
        0 likes
        Last Post love2code2trade  
        Started by funk10101, Today, 09:43 PM
        0 responses
        8 views
        0 likes
        Last Post funk10101  
        Started by pkefal, 04-11-2024, 07:39 AM
        11 responses
        37 views
        0 likes
        Last Post jeronymite  
        Working...
        X