Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exit At Market Price then Summit New Limit Order

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

    Exit At Market Price then Summit New Limit Order

    I have a very simple Strategy as following:

    If SMA(Fast) CrossAbove SMA(Slow) then
    1. Exit Short @ Market Price
    2. Entry Limit Long @ ( High[1]+Low[1] ) / 2
    3. Cancel the Limit Order if Not Filled within One Bar

    If SMA(Fast) CrossBelow SMA(Slow) then
    1. Exit Long @ Market Price
    2. Entry Limit Short @ ( High[1]+Low[1] ) / 2
    3. Cancel the Limit Order if Not Filled within One Bar


    So I try to program my strategy as following:

    // Condition set 1
    if ( CrossAbove(SMA(N_Fast), SMA(N_Slow), 1) )
    {
    ExitShort( "Exit Short", "Crossover Short" );
    double lmtPrice = ( High[1] + Low[1] ) / 2;
    EnterLongLimit( lmtPrice, "Crossover Long" );
    }

    // Condition set 2
    if ( CrossBelow(SMA(N_Fast), SMA(N_Slow), 1) )
    {
    ExitLong( "Exit Long", "Crossover Long" );
    double lmtPrice = ( High[1] + Low[1] ) / 2;
    EnterShortLimit( lmtPrice, "Crossover Short" );
    }


    However, when CrossBelow occurs, it will enter new sell limit order only if I have no existing long position. When I have long position, it will exit my Long @ market price, but never entry a new sell limit order. Same thing happens on CrossAbove.

    I have checked the TraceOrders output, it stated the reason as: "An Enter() method to submit an entry order has been ignored. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation."

    What I need is to exit position at market price and summit a new limit order. Is it possible get around the "Internal Order Handling Rules" restriction without going into unmanaged order approach?

    #2
    Hello traderclivelam,

    Thank you for your post and welcome to the NinjaTrader Support Forum!

    Unfortunately, there would not be any way around the internal order handling rules at the following link: http://www.ninjatrader.com/support/h...d_approach.htm

    If you want to exit with a market order and then enter with a limit order you would need to use the Unmanaged approach. You could just use the Enter method without the Exit method as this would reverse the order but in this case it would use a limit order.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    61 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    40 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    21 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    23 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    51 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X