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 geddyisodin, Today, 05:20 AM
    0 responses
    3 views
    0 likes
    Last Post geddyisodin  
    Started by JonesJoker, 04-22-2024, 12:23 PM
    6 responses
    32 views
    0 likes
    Last Post JonesJoker  
    Started by GussJ, 03-04-2020, 03:11 PM
    12 responses
    3,239 views
    0 likes
    Last Post Leafcutter  
    Started by AveryFlynn, Today, 04:57 AM
    0 responses
    5 views
    0 likes
    Last Post AveryFlynn  
    Started by RubenCazorla, 08-30-2022, 06:36 AM
    3 responses
    79 views
    0 likes
    Last Post PaulMohn  
    Working...
    X