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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    633 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    364 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    567 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    568 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X