public void ProcessOrderCommand(TradingOrderCommand trade_order_command) { //TODO check price and return error codes!!! //TODO merge close order and modify order in here switch (trade_order_command.OrderType) { case TradingOrderType.Long: OpenOrders.Add(next_order_ticket, new TradingOrder(trade_order_command.OrderType, next_order_ticket, CurrentDateTime, CurrentAsk, trade_order_command.Volume, this.CommissionPerUnit * trade_order_command.Volume, trade_order_command.UseLimits, trade_order_command.StopLoss, trade_order_command.TakeProfit)); next_order_ticket++; break; case TradingOrderType.Short: OpenOrders.Add(next_order_ticket, new TradingOrder(trade_order_command.OrderType, next_order_ticket, CurrentDateTime, CurrentBid, trade_order_command.Volume, this.CommissionPerUnit * trade_order_command.Volume, trade_order_command.UseLimits, trade_order_command.StopLoss, trade_order_command.TakeProfit)); next_order_ticket++; break; default: throw new NotImplementedException(); } }
public void ProcessOrderEvent(TradingOrderCommand trade_order_command) { //TODO check price and return error codes!!! //TODO merge close order and modify order in here }