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 SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        50 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        22 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        16 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        22 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        23 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X