Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MRO not working

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

    MRO not working

    Trying to get an MRO function to work.
    My logic is complicated and was not firing.. so tried the basic example from the help site. That didn't work as well.

    Here is the section of the code.. only writes to Output window, no buy/sell signals:
    protected override void OnBarUpdate()
    {
    int barsAgo = MRO(delegate {return Close[0] > Open[0];}, 100, 1);
    if (barsAgo > -1)
    Print("The Value of the Pivot was " + High[barsAgo]);
    Print(Time[0].ToString() + " : New Bar. barsAgo value is: " + barsAgo.ToString());

    }

    This was run on e-mini S&P over a 1 min & 5 min period with same results

    Output window shows:
    08/01/07 11:30:00 AM : New Bar. barsAgo value is: -1
    08/01/07 11:40:00 AM : New Bar. barsAgo value is: -1
    08/01/07 11:50:00 AM : New Bar. barsAgo value is: -1
    08/01/07 12:00:00 PM : New Bar. barsAgo value is: -1
    08/01/07 12:10:00 PM : New Bar. barsAgo value is: -1
    08/01/07 12:20:00 PM : New Bar. barsAgo value is: -1
    08/01/07 12:30:00 PM : New Bar. barsAgo value is: -1
    08/01/07 12:40:00 PM : New Bar. barsAgo value is: -1
    08/01/07 12:50:00 PM : New Bar. barsAgo value is: -1 etc etc

    #2
    Sorry, the doc sample is incorrect. We'll fix shortly. Please swap parameter 2 and 3:

    MRO(delegate {return Close[0] > Open[0];}, 1, 100);

    Comment


      #3
      MRO not working - now working

      Works like a charm. Thanks.

      Will I get a discount for finding "bugs" in the Help file when I sign up ?
      I'm moving over an awful lot of code over from Metastock!

      Originally posted by NinjaTrader_Dierk View Post
      Sorry, the doc sample is incorrect. We'll fix shortly. Please swap parameter 2 and 3:

      MRO(delegate {return Close[0] > Open[0];}, 1, 100);

      Comment


        #4
        You will get a discount as you bring in tons of new licensed users
        Seriously: Please contact "sales AT ninjatrader DOT com" if you feel yourself entitled for a discount.

        Comment

        Latest Posts

        Collapse

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