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

MAX/MIN limits

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

    MAX/MIN limits

    I am trying to use the MAX or MIN functions as part of an if condition to determine if a built-in indicator has attained at least a specified value over the past number of bars. For example,

    if MAX(MACD(4,5,3),5) > .05

    I get a message that the > operator cannot be used with MAX.

    How can I do this?

    #2
    Hi Richard,

    In case you may have not seen this, the following section of our Help Guide might be of some value.



    You are trying to compare the indicator to a value of 0.05 NOT the value of the indicator at a specific bar. It should be written as:

    if (MAX(MACD(4, 5, 3), 5)[0] > 0.05)
    // Do something

    Not the reference to the value of the indicator at the current bar by using [0].
    RayNinjaTrader Customer Service

    Comment


      #3
      You are very patient. Thank you for the help.

      Little by little some of this is sinking in. I have read the DataSeries reference several times, but when you are starting out it is very confusing. I'll keep working on it.

      Comment


        #4
        No problem Richard. What I have personally done in the past when challenged with new concepts is to start off with simple tasks and layer complexity on top of it. This has always helped keep the 'learning' under control.
        RayNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by hdge4u, Yesterday, 12:23 PM
        1 response
        10 views
        0 likes
        Last Post hdge4u
        by hdge4u
         
        Started by 1001111, Today, 09:45 AM
        0 responses
        3 views
        0 likes
        Last Post 1001111
        by 1001111
         
        Started by DTSSTS, 01-28-2024, 12:07 PM
        11 responses
        557 views
        0 likes
        Last Post bmo111
        by bmo111
         
        Started by Torontobluejays, Today, 08:43 AM
        0 responses
        1 view
        0 likes
        Last Post Torontobluejays  
        Started by sastrades, 01-31-2024, 10:19 PM
        12 responses
        193 views
        0 likes
        Last Post sastrades  
        Working...
        X