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", "");
}
Comment