FastQuant.Order.OnExecutionReport C# (CSharp) Method

OnExecutionReport() public method

public OnExecutionReport ( ExecutionReport report ) : void
report ExecutionReport
return void
        public void OnExecutionReport(ExecutionReport report)
        {
            Status = report.OrdStatus;
            if (report.ExecType == ExecType.ExecTrade)
                AvgPx = (AvgPx  * CumQty + report.LastPx * report.LastQty) / (CumQty + report.LastQty);

            CumQty = report.CumQty;
            LeavesQty = report.LeavesQty;

            if (report.ExecType == ExecType.ExecNew)
                ProviderOrderId = report.ProviderOrderId;

            if (report.ExecType == ExecType.ExecReplace)
            {
                Type = report.OrdType;
                Price = report.Price;
                StopPx = report.StopPx;
                Qty = report.OrdQty;
            }

            Reports.Add(report);
            Messages.Add(report);
        }