Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MRO function and order entry

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

    MRO function and order entry

    Hi.

    I am using the MRO function to check for a condition of an indicator. Here is a brief outline of the code.

    if ((FlagFT[0] == 1) || ((MRO(delegate {return FlagFT[0] == 1;}, 1, 10) > 0 && MRO(delegate {return FlagFT[0] == 1;}, 1, 10) <= 5)))
    {
    if ((FlagStochastics[0] == 1))
    {
    EnterLong (1,"FTlong");
    }
    }

    FlagFT and Flagstochastics are a dataseries of 1's and 0's.

    So what I want to do is check if the condition is present in the last 5 bars of one indicator and if it is at the same time another condition (Flagstochastics) is true, then enter a trade on the first bar that the conditions are true at the same time

    What is occuring:

    The order entry is happening after the last bar of the MRO condition which is, in the example above, 5 bars after the desired entry point.

    I have played with the MRO function a bit without much success. Is this a fault or am I using it wrong?

    Steve
    Last edited by raz0rback; 06-15-2008, 09:53 PM.

    #2
    Not sure I follow what you mean. The MRO() tells you the bar your condition was true at. It is just a matter of simply matching that bar with your other condition.

    You should break down your code into simpler code segments and debug sequentially.
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

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