public void OnLMTApply(LMTProcessForInstrument lMTProcessForInstrument) { string newAskPrice = lMTProcessForInstrument.AskPrice; string newBidPrice = lMTProcessForInstrument.BidPrice; foreach (OrderTask orderTask in lMTProcessForInstrument.OrderTasks) { if (orderTask.IsBuy == BuySell.Buy) { orderTask.SetPrice = newAskPrice; } else { orderTask.SetPrice = newBidPrice; } } }
public void OnLMTExecute(LMTProcessForInstrument lMTProcessForInstrument) { foreach (OrderTask orderTask in lMTProcessForInstrument.OrderTasks) { if (orderTask.IsSelected) { bool? isValidPrice = OrderTaskManager.IsValidPrice(orderTask.Instrument, decimal.Parse(orderTask.SetPrice)); if (isValidPrice.HasValue) { if (isValidPrice.Value) { //合法 string executePrice = orderTask.IsBuy == BuySell.Buy ? lMTProcessForInstrument.Instrument.Ask : lMTProcessForInstrument.Instrument.Bid; this.Commit(orderTask, executePrice, (decimal)orderTask.Lot); } } else { string msg = "Out of Range,Accept or Reject?"; this.ConfirmOrderDialogWin.ShowRejectOrderWin(msg, orderTask, HandleAction.OnLMTExecute); } } } }