Esempio n. 1
0
        private void API_OnReceiveTrCondition(object sender, _DKHOpenAPIEvents_OnReceiveTrConditionEvent e)
        {
            string codeList = e.strCodeList.Trim();

            if (codeList.Length > 0)
            {
                codeList = codeList.Remove(codeList.Length - 1);
            }

            if (string.IsNullOrEmpty(codeList))
            {
                Logger(Log.일반, "해당 조건 검색 종목 없음");
                this.dataGridViewStockInfo.DataSource = null;
                return;
            }

            int count = codeList.Trim().Split(';').Length;

            if (e.nNext == 2)
            {
                axKHOpenAPI.SendCondition(e.sScrNo, e.strConditionName, e.nIndex, 2);
            }
            if (count > 100)
            {
                count = 100;
                Logger(Log.일반, "100개만 조회가능");
            }
            axKHOpenAPI.CommKwRqData(codeList, 0, count, 0, "조건검색주식기본정보", GetScreenNum());
        }
Esempio n. 2
0
        private void KHOpenAPI_OnReceiveTrCondition(object sender, _DKHOpenAPIEvents_OnReceiveTrConditionEvent e)
        {
            if (e.strCodeList.Length > 0)
            {
                string   stockCodeString = e.strCodeList.Remove(e.strCodeList.Length - 1);
                string[] stockCodeArray  = stockCodeString.Split(';');

                int    index      = 1;
                string stockcodes = "";
                foreach (string stockcode in stockCodeArray)
                {
                    stockcodes += stockcode + ';';
                    index++;
                    if (index % 100 == 0 || stockcode == stockCodeArray.Last())
                    {
                        stockcodes.Remove(stockcodes.Length - 1);
                        axKHOpenAPI1.CommKwRqData(stockcodes, 0, index, 0, "조건검색종목", "0");
                        stockcodes = "";
                    }
                }
                if (e.nNext != 0)                                                     //연속조회여부 , 320개 이상 더 종목이 있을때 한번 더 조건검색을 요청한다.
                {
                    axKHOpenAPI1.SendCondition("0", e.strConditionName, e.nIndex, 1); //
                }
            }
            else
            {
                MessageBox.Show("검색된 종목이 없습니다.");
            }
        }
Esempio n. 3
0
 public void OnReceiveTrConditionEventHandler(object sender, _DKHOpenAPIEvents_OnReceiveTrConditionEvent e)
 {
     if (OnReceiveTrConditionUri != null)
     {
         JObject body = new JObject();
         body["sScrNo"]           = e.sScrNo;
         body["strCodeList"]      = e.strCodeList;
         body["strConditionName"] = e.strConditionName;
         body["nIndex"]           = e.nIndex;
         body["nNext"]            = e.nNext;
         HttpContent content = new StringContent(body.ToString(), Encoding.UTF8, "application/json");
         client.PostAsync(OnReceiveTrConditionUri, content);
     }
 }
Esempio n. 4
0
 void OnReceiveTrConditions(object sender, _DKHOpenAPIEvents_OnReceiveTrConditionEvent e) => new Task(() =>