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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        62 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        33 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        44 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        58 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        47 views
        0 likes
        Last Post CarlTrading  
        Working...
        X