Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stop order quantity didnt increase as partial fills got executed

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

    Stop order quantity didnt increase as partial fills got executed

    i have the below code in my strategy,

    today i got a submitted an order for 351 lots
    i got partial fills for 15 50 and 286
    for some reason the size of the stop order only went up to 65 lots rather than 351.
    the stop order size didnt update for the final fill

    Can you see any issues in code below that would have caused this to occur



    protected override void OnExecution(IExecution execution)
    {
    if (entryOrder != null && entryOrder == execution.Order)
    {
    if (execution.Order.OrderState == OrderState.Filled || execution.Order.OrderState == OrderState.PartFilled || (execution.Order.OrderState == OrderState.Cancelled && execution.Order.Filled > 0))
    {
    if (LongOrder == true)
    {
    // Long Stop-Loss
    stopOrder = ExitLongStopLimit(0, true, execution.Order.Filled,StopLine - SlipAmount * TickSize,StopLine , "StopLine", "");

    // Long Target
    targetOrder = ExitLongLimit(0, true, execution.Order.Filled, TargetLine, "Target", "");
    }
    else
    {
    //Short Stop-Loss
    stopOrder = ExitShortStopLimit(0, true, execution.Order.Filled,StopLine + SlipAmount * TickSize,StopLine , "StopLine", "");

    // Short Target
    targetOrder = ExitShortLimit(0, true, execution.Order.Filled, TargetLine, "Target", "");
    }

    #2
    Hello,

    Thank you for the question.

    I currently do not see what may be happening by what is posted, have you at this point used Prints in the OnExecution to see when the stop order is being set what values are being passed and how frequently it gets set?

    That would be a good starting point, outside of that you may try TraceOrders to see if you are running into any problems with the orders : http://ninjatrader.com/support/helpG...ub=traceorders

    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    51 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    142 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    160 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    96 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    275 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X