Beispiel #1
0
 private void OnReceiveMsg(object sender, _DKHOpenAPIEvents_OnReceiveMsgEvent e)
 {
     if (!e.sMsg.Contains("신규주문"))
     {
         SendConfirm?.Invoke(this, new EventHandler.Identify(e.sMsg.Substring(8)));
     }
 }
Beispiel #2
0
 private void OnReceiveMsg(object sender, _DKHOpenAPIEvents_OnReceiveMsgEvent e)
 {
     if (!e.sMsg.Contains("신규주문"))
     {
         Box.Show(e.sMsg.Substring(8), "Caution", waiting / 3);
     }
 }
Beispiel #3
0
 private void API_OnReceiveMsg(object sender, _DKHOpenAPIEvents_OnReceiveMsgEvent e)
 {
     if (e.sRQName.Equals("주식주문"))
     {
         Logger(Log.에러, e.sMsg);
     }
 }
Beispiel #4
0
        private void OnReceiveMsg(object sender, _DKHOpenAPIEvents_OnReceiveMsgEvent e)
        {
            if (!e.sMsg.Contains("신규주문") && !e.sMsg.Contains("지연"))
            {
                Box.Show(e.sMsg.Substring(8), "Caution", 895);

                string[] arr = e.sRQName.Split(';');

                OnReceiveOrder(new Elements(Number.GetScreen(), arr[2], arr[3], arr[0], arr[1]));
            }
            SendError?.Invoke(this, new Error(e.sTrCode, e.sRQName, e.sScrNo, e.sMsg));
        }
Beispiel #5
0
        void OnReceiveMsg(object sender, _DKHOpenAPIEvents_OnReceiveMsgEvent e)
        {
            if (Array.Exists(basic, o => o.Equals(e.sMsg.Substring(9))))
            {
                var temp = e.sMsg.Substring(9);

                if ((temp.Equals(basic[2]) || temp.Equals(basic[6]) || temp.Equals(basic[8])) && OnReceiveBalance == false)
                {
                    OnReceiveBalance = request.QueueCount == 0 ? true : false;
                }

                if (e.sMsg.Contains("모의투자"))
                {
                    temp = temp.Replace("모의투자 ", string.Empty);
                }

                if (e.sMsg.Last().Equals('다') || e.sMsg.Last().Equals('요'))
                {
                    temp = string.Concat(temp, ".");
                }

                SendState?.Invoke(this, new State(OnReceiveBalance, SellOrder.Count, Quantity, BuyOrder.Count, ScreenNumber));
                SendCount?.Invoke(this, new NotifyIconText(temp));

                return;
            }
            if (e.sMsg.Equals(TR))
            {
                SendMemorize?.Invoke(this, new Memorize("Clear"));
                Request(GetRandomCode(new Random().Next(0, CodeList.Count)));

                return;
            }
            if (e.sMsg.Equals(Failure))
            {
                Process.Start("shutdown.exe", "-r");
                Dispose();

                return;
            }
            if (e.sMsg.Contains(Response) && TimerBox.Show(string.Concat(Response, "."), GoblinBat, MessageBoxButtons.OKCancel, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2, 1375).Equals(DialogResult.OK))
            {
                return;
            }

            if (e.sMsg.Substring(9).Equals(LookUp))
            {
                return;
            }

            new ExceptionMessage(e.sMsg);
        }
Beispiel #6
0
 public void OnReceiveMsgEventHandler(object sender, _DKHOpenAPIEvents_OnReceiveMsgEvent e)
 {
     if (OnReceiveMsgUri != null)
     {
         JObject body = new JObject();
         body["sScrNo"]  = e.sScrNo;
         body["sRQName"] = e.sRQName;
         body["sTrCode"] = e.sTrCode;
         body["sMsg"]    = e.sMsg;
         HttpContent content = new StringContent(body.ToString(), Encoding.UTF8, "application/json");
         client.PostAsync(OnReceiveMsgUri, content);
     }
 }
Beispiel #7
0
 void OnReceiveMessage(object sender, _DKHOpenAPIEvents_OnReceiveMsgEvent e)
 => Send?.Invoke(this, new SendSecuritiesAPI(string.Concat("[", e.sRQName, "] ", e.sMsg[9..], "(", e.sScrNo, ")")));
Beispiel #8
0
 void OnReceiveMsg(object sender, _DKHOpenAPIEvents_OnReceiveMsgEvent e)
 => Send?.BeginInvoke(this, new SendSecuritiesAPI(string.Concat("[", e.sRQName, "] ", e.sMsg.Substring(9), "(", e.sScrNo, ")")), null, null);
Beispiel #9
0
 private static void AxKHOpenAPI1_OnReceiveMsg(object sender, _DKHOpenAPIEvents_OnReceiveMsgEvent e)
 {
     Debug.Info("RQ: {0}, TR: {1} - {2}", e.sRQName, e.sTrCode, e.sMsg);
 }
Beispiel #10
0
 private void OnReceiveMsg(object sender, _DKHOpenAPIEvents_OnReceiveMsgEvent e)
 {
 }