Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stop Loss order getting cancelled before fill

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

    Stop Loss order getting cancelled before fill

    My Stop Loss order getting cancelled before fill, If price difference more than 40 Ticks it placed the SL and when tick difference below 40 it cancels the SL. Can you check what I am missing?

    if (CrossAbove(EMA( 5), EMA( 21), 1))
    {
    EnterLong(Convert.ToInt32(DefaultQuantity), "");
    }



    if (CrossBelow(EMA( 5), EMA( 21), 1))
    {
    EnterShort(Convert.ToInt32(DefaultQuantity), "");
    }


    if (Position.MarketPosition == MarketPosition.Long && Close[0] > (Position.AveragePrice + 40 * TickSize) ) //if more than 200 SL 100
    {
    ExitLongStopMarket( (Position.AveragePrice + (20 * TickSize)) );
    }

    else if (Position.MarketPosition == MarketPosition.Short && (Position.AveragePrice - 40 * TickSize )> Close[0])
    {


    ExitShortStopMarket( (Position.AveragePrice - (20 * TickSize)) );
    }

    #2
    Hello Akee5,

    Use prints and TraceOrders to understand behavior.
    https://ninjatrader.com/support/foru...121#post791121


    Orders that are automatically cancelled will have a message from TraceOrders.

    I'm seeing that these are not using isLiveUntilCancelled.
    https://ninjatrader.com/support/foru...332#post547332

    May I confirm that the condition to re-submit the exit order is evaluating as true when the order becomes cancelled?
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by focus333, Today, 05:34 PM
    1 response
    24 views
    0 likes
    Last Post bltdavid  
    Started by RaddiFX, Today, 07:48 PM
    0 responses
    6 views
    0 likes
    Last Post RaddiFX
    by RaddiFX
     
    Started by smcllr, Today, 05:41 PM
    0 responses
    23 views
    0 likes
    Last Post smcllr
    by smcllr
     
    Started by trader3000a, Today, 02:28 PM
    1 response
    24 views
    0 likes
    Last Post NinjaTrader_Kate  
    Started by mcosta72, Today, 02:25 PM
    0 responses
    19 views
    0 likes
    Last Post mcosta72  
    Working...
    X