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.



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

    I'm seeing that these are not using isLiveUntilCancelled.


    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 alifarahani, Today, 09:40 AM
    4 responses
    19 views
    0 likes
    Last Post alifarahani  
    Started by gentlebenthebear, Today, 01:30 AM
    3 responses
    16 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by PhillT, Today, 02:16 PM
    2 responses
    7 views
    0 likes
    Last Post PhillT
    by PhillT
     
    Started by Kaledus, Today, 01:29 PM
    3 responses
    11 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by frankthearm, Yesterday, 09:08 AM
    14 responses
    47 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Working...
    X