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