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

MRO + MAX/MIN functions

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

    MRO + MAX/MIN functions

    I was hoping to have get advice on a code segment using the MRO and MAX or MIN functions something such as

    Code:
    mroHigh = MRO((MAX(High, 10)[0]), 1, 20);
    Would this evaluate to find the most recent occurrence of the max high close price over the last 20 bars?

    #2
    Hello MisterGee,

    MRO() requires a lambda bool condition as the Func<bool> condition parameter, not a double.


    Perhaps you want HighestBar?
    https://ninjatrader.com/support/help...highestbar.htm
    https://ninjatrader.com/support/foru...96#post1113896
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you Chelsea, that is helpful. I will play with this tonight and see if it works for me.

      I would like to find, for example, the most recent highest bar and compare it's value to the second most recent highest bar value. -- if this changes your response at all?

      Comment


        #4
        Hello MisterGee,

        HighestBar could find the most recent occurrence of the max high close price over the last 20 bars as you inquired in your first inquiry.

        Finding the "the second most recent highest bar value" would require custom logic.

        With MRO you could find the previous recent bar that had that same high by providing a lambda condition and not a double.. (() => High[0] == MAX(High, 20)[0])
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Kaledus, Today, 01:29 PM
        0 responses
        1 view
        0 likes
        Last Post Kaledus
        by Kaledus
         
        Started by PaulMohn, Today, 12:36 PM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by yertle, Yesterday, 08:38 AM
        8 responses
        36 views
        0 likes
        Last Post ryjoga
        by ryjoga
         
        Started by rdtdale, Today, 01:02 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by alifarahani, Today, 09:40 AM
        3 responses
        17 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X