• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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.
    Patrick H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by giogio1, 11-10-2019, 11:23 PM
    4 responses
    14 views
    0 likes
    Last Post bltdavid  
    Started by Dolosumo, Today, 01:05 AM
    0 responses
    1 view
    0 likes
    Last Post Dolosumo  
    Started by StevenNelson, Yesterday, 07:31 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_ChrisSch  
    Started by dtl-saw, Yesterday, 09:37 PM
    0 responses
    2 views
    0 likes
    Last Post dtl-saw
    by dtl-saw
     
    Started by TazoTodua, Yesterday, 03:01 PM
    3 responses
    13 views
    0 likes
    Last Post TazoTodua  
    Working...
    X