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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    52 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    23 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    16 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    23 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    24 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X