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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        59 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        143 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        161 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        97 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        283 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X