ls증권 히스토리 구독 넣음

This commit is contained in:
Your Name
2026-07-30 18:05:07 +09:00
parent 61bec4bd1d
commit 67eab24603
1593 changed files with 135733 additions and 1232 deletions

View File

@@ -0,0 +1,63 @@
# from tr.tr_0424 import Tr_0424
# tr_0424=Tr_0424()
import os
#XReal_S3_
class XReal_S3_:
def __init__(self):
super().__init__()
self.count = 0
# self.tr_0424=tr_0424
def OnReceiveRealData(self, tr_code): # event handler
"""
이베스트 서버에서 ReceiveRealData 이벤트 받으면 실행되는 event handler
"""
shcode = self.GetFieldData("OutBlock", "shcode")
price = self.GetFieldData("OutBlock", "price")
if shcode is not None and price is not None:
self.process_balance_change(shcode,price)
# chetime = self.GetFieldData("OutBlock", "chetime")
# print('코스피 코드: ',shcode)
# print('price: ',price)
# #print('chetime: ',chetime)
# self.continue_draw_balance_table()
def initialize_continue_draw_balance_table(self,continue_draw_balance_table):
#print('s3 initialize_continue_draw_balance_table @#@#@#@#@#@#@#')
self.continue_draw_balance_table=continue_draw_balance_table
def initialize_process_balance_change(self,process_balance_change):
#print('s3 initialize_process_balance_change @#@#@#@#@#@#@#')
self.process_balance_change=process_balance_change
def start(self,stock_code):
#print('코스피 리얼 스타트: ',stock_code)
# #print('왜 자꾸 콜하는겨')
"""
이베스트 서버에 실시간 data 요청함.
"""
the_path=os.environ.get('ROOT_FILE_PATH')+"\\Res\\S3_.res"
self.ResFileName = the_path # RES 파일 등록
# self.ResFileName = "C:\\eBEST\\xingAPI\\Res\\S3_.res" # RES 파일 등록
self.SetFieldData("InBlock", "shcode", stock_code)
self.AdviseRealData() # 실시간데이터 요청
def add_item(self, stockcode):
# 실시간데이터 요청 종목 추가
self.SetFieldData("InBlock", "shcode", stockcode)
self.AdviseRealData()
def remove_item(self, stockcode):
# stockcode 종목만 실시간데이터 요청 취소
self.UnadviseRealDataWithKey(stockcode)
def end(self):
self.UnadviseRealData() # 실시간데이터 요청 모두 취소