protected void Reject(ExecutionCommand command, string format, params object[] args)
{
var report = new ExecutionReport
{
DateTime = this.framework.Clock.DateTime,
Order = command.Order,
OrderId = command.OrderId,
Instrument = command.Instrument,
InstrumentId = command.InstrumentId,
CurrencyId = command.Instrument.CurrencyId,
OrdType = command.Order.Type,
Side = command.Order.Side,
OrdQty = command.Order.Qty,
Price = command.Order.Price,
StopPx = command.Order.StopPx,
TimeInForce = command.Order.TimeInForce,
AvgPx = command.Order.AvgPx,
CumQty = command.Order.CumQty,
LeavesQty = command.Order.LeavesQty
};
switch (command.Type)
{
case ExecutionCommandType.Send:
report.ExecType = ExecType.ExecRejected;
report.OrdStatus = OrderStatus.Rejected;
break;
case ExecutionCommandType.Cancel:
report.ExecType = ExecType.ExecCancelReject;
report.OrdStatus = command.Order.Status;
break;
case ExecutionCommandType.Replace:
report.ExecType = ExecType.ExecReplaceReject;
report.OrdStatus = command.Order.Status;
break;
}
report.Text = format != null ? string.Format(format, args) : report.Text;
EmitExecutionReport(report, true);
}