Example #1
0
 public void axKHOpenAPI_OnReceiveRealData(object sender, AxKHOpenAPILib._DKHOpenAPIEvents_OnReceiveRealDataEvent apiEvent)
 {
     try {
         if (apiEvent.sRealType == "주식시세")
         {
             Logger.getInstance.print(Log.StockAPI콜백, "종목코드 : {0} | 현재가 : {1:C} | 등락율 : {2} | 누적거래량 : {3:N0} ",
                                      apiEvent.sRealKey,
                                      Int32.Parse(khOpenApi_.GetCommRealData(apiEvent.sRealType, 10).Trim()),
                                      khOpenApi_.GetCommRealData(apiEvent.sRealType, 12).Trim(),
                                      Int32.Parse(khOpenApi_.GetCommRealData(apiEvent.sRealType, 13).Trim()));
         }
     }
     catch (AccessViolationException execption) {
         Logger.getInstance.print(Log.에러, "[주식 데이터 콜백 에러] {0}\n{1}\n{2}", execption.Message, execption.StackTrace, execption.InnerException);
     }
     this.runNextOrderFlag();
 }