Exemplo n.º 1
0
        /// <summary>
        /// 通知登入結果事件
        /// </summary>
        private static void MrWangConnection_OnLogonReply(int Code, string Msg)
        {
            if (Code == 0)
            {
                //登入成功
                Console.WriteLine("登入成功。");
                Console.WriteLine("訂閱商品TXFD9。");
                MrWangConnection.SubscribeQuote("TXFD9", 20);

                //產生下單物件
                MoveStopOrder order = new MoveStopOrder()
                {
                    Symbol    = "TXFD9",
                    Side      = SideEnum.Sell,
                    StopPrice = 10810,
                    TickCount = 5,
                    Tick      = 1,
                    Qty       = 1,
                };

                //下單
                SendMOVSTP(order);
            }
            else
            {
                //登入失敗
                Console.WriteLine($"Code:{Code} Msg:{Msg}");
            }
        }
Exemplo n.º 2
0
 private static void SendMOVSTP(MoveStopOrder order)
 {
     orders.Add(order);
     Console.WriteLine($"新增一筆MOV STP :" +
                       $"{order.Side} {order.Qty} {order.Symbol} @ {order.StopPrice} TickCount:{order.TickCount}");
 }