Beispiel #1
0
        private void OnOrderConfirm()
        {
            _wait = true;

            OpenApi.SetInputValue("계좌번호", _account);
            OpenApi.SetInputValue("전체종목구분", "0");
            OpenApi.SetInputValue("매매구분", "0");
            OpenApi.SetInputValue("체결구분", "1");
            OpenApi.CommRqData("실시간미체결요청", "opt10075", delegate(_DKHOpenAPIEvents_OnReceiveTrDataEvent e)
            {
                int count      = OpenApi.GetRepeatCnt(e);
                bool hasRemain = false;
                for (int i = 0; i < count; ++i)
                {
                    var name   = OpenApi.GetTrData(e, "종목명", i);
                    var remain = OpenApi.GetTrData(e, "미체결수량", i).ToInt();
                    if (remain > 0)
                    {
                        hasRemain = true;
                        break;
                    }
                }

                _wait = false;
                MoveState(hasRemain ? EPhase.Begin : EPhase.Balance);
            });
        }
Beispiel #2
0
        private void Request(string code, DateTime begin, DateTime end, StockPriceCollection collection, string interval,
                             IProgress <int> progress, int seq = 0)
        {
            _code     = code;
            _begin    = begin;
            _end      = end;
            _progress = progress;
            _interval = interval;

            OpenApi.SetInputValue("종목코드", code);
            if (IsDaily())
            {
                OpenApi.SetInputValue("기준일자", _end.ToString("yyyyMMdd"));
            }
            else
            {
                OpenApi.SetInputValue("틱범위", interval);
            }

            OpenApi.SetInputValue("수정주가구분", "0");
            OpenApi.CommRqData("차트구하기", IsDaily() ? "opt10081" : "opt10080", collection.PriceCallback, seq);
        }