Пример #1
0
        public void runReceiveChejanData(AxKHOpenAPILib.AxKHOpenAPI axKHOpenAPI, AxKHOpenAPILib._DKHOpenAPIEvents_OnReceiveChejanDataEvent e)
        {
            ReceiveChejanData rt = getReceiveChejanData(e.sGubun.Trim(), axKHOpenAPI.GetChejanData(913).ToString().Trim());

            if (rt != null)
            {
                rt.ReceivedData(axKHOpenAPI, e);
            }
        }
Пример #2
0
        // 체결 주문 관련
        public void axKHOpenAPI_OnReceiveChejanData(object sender, AxKHOpenAPILib._DKHOpenAPIEvents_OnReceiveChejanDataEvent apiEvent)
        {
            try {
                if (apiEvent.sGubun == "0")
                {
                    string stockName = khOpenApi_.GetChejanData(302);

                    // 주문 수량
                    string tradingAmountStr = khOpenApi_.GetChejanData(900);
                    int    tradingAmount    = 0;
                    if (int.TryParse(tradingAmountStr, out tradingAmount))
                    {
                    }

                    // 체결 수량
                    string tradingCountStr = khOpenApi_.GetChejanData(911);
                    int    tradingCount    = 0;
                    if (int.TryParse(tradingCountStr, out tradingCount))
                    {
                    }

                    // 주식 코드
                    string codeStr = khOpenApi_.GetChejanData(9001);
                    int    code    = 0;
                    if (Int32.TryParse(codeStr, out code))
                    {
                    }
                }
                else if (apiEvent.sGubun == "1")
                {
                    Logger.getInstance.print(Log.StockAPI콜백, "구분 : 잔고통보");
                }
                else if (apiEvent.sGubun == "3")
                {
                    Logger.getInstance.print(Log.StockAPI콜백, "구분 : 특이신호");
                }
            }
            catch (AccessViolationException execption) {
                Logger.getInstance.print(Log.에러, "[채결 / 잔고 처리 콜백 에러] {0}\n{1}\n{2}", execption.Message, execption.StackTrace, execption.InnerException);
            }
            this.runNextOrderFlag();
        }