/// <summary> /// 通知登入結果事件 /// </summary> private static void MrWangConnection_OnLogonReply(int Code, string Msg) { if (Code == 0) { //登入成功 Console.WriteLine("登入成功。"); Console.WriteLine("訂閱商品TXFD9。"); MrWangConnection.SubscribeQuote("TXFD9", 20); CanceledOrder canceledOrder = new CanceledOrder() { Symbol = "TXFD9", Side = SideEnum.Buy, Qty = 1, Price = 10800, OrderType = OrderTypeEnum.otLimit, TimeInForce = TimeInForceEnum.ROD, TimeOut = DateTime.Now.AddSeconds(10) }; SendTimeCancelOrder(canceledOrder); } else { //登入失敗 Console.WriteLine($"Code:{Code} Msg:{Msg}"); } }
private static void SendTimeCancelOrder(CanceledOrder canceledOrder) { canceledOrder.OrderBook = MrWangConnection.SnedOrder(canceledOrder); listTimeCancel.Add(canceledOrder); }