init
This commit is contained in:
@@ -18,7 +18,7 @@ class HTS_122630 (HTS):
|
|||||||
buySellChecker = None
|
buySellChecker = None
|
||||||
|
|
||||||
def __init__(self, RESOURCE_PATH, stock_code, buy_count):
|
def __init__(self, RESOURCE_PATH, stock_code, buy_count):
|
||||||
super().__init__()
|
super().__init__(RESOURCE_PATH)
|
||||||
|
|
||||||
self.RESOURCE_PATH = RESOURCE_PATH
|
self.RESOURCE_PATH = RESOURCE_PATH
|
||||||
self.stock_code = stock_code
|
self.stock_code = stock_code
|
||||||
|
|||||||
12
hts/HTS.py
12
hts/HTS.py
@@ -1,3 +1,5 @@
|
|||||||
|
import os.path
|
||||||
|
|
||||||
import win32com.client
|
import win32com.client
|
||||||
import csv
|
import csv
|
||||||
import time
|
import time
|
||||||
@@ -8,8 +10,10 @@ class HTS:
|
|||||||
|
|
||||||
objCpCybos = None
|
objCpCybos = None
|
||||||
objCpCodeMgr = None
|
objCpCodeMgr = None
|
||||||
|
RESOURCE_PATH = None
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self, RESOURCE_PATH):
|
||||||
|
self.RESOURCE_PATH = RESOURCE_PATH
|
||||||
#self.connect()
|
#self.connect()
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -383,7 +387,8 @@ class HTS:
|
|||||||
# 차트 객체 구하기
|
# 차트 객체 구하기
|
||||||
objStockChart = win32com.client.Dispatch("CpSysDib.StockChart")
|
objStockChart = win32com.client.Dispatch("CpSysDib.StockChart")
|
||||||
|
|
||||||
outfp = open("./hts/"+stock_code+"_"+today+".csv", mode="w", encoding="utf-8")
|
timecheck_filename = os.path.join(self.RESOURCE_PATH, "hts", stock_code+"_"+today+".csv")
|
||||||
|
outfp = open(timecheck_filename, mode="w", encoding="utf-8")
|
||||||
objStockChart.SetInputValue(0, 'A' + stock_code) # 종목 코드
|
objStockChart.SetInputValue(0, 'A' + stock_code) # 종목 코드
|
||||||
objStockChart.SetInputValue(1, ord('1')) # 1: 기간으로 조회, 2: 개수로 조회
|
objStockChart.SetInputValue(1, ord('1')) # 1: 기간으로 조회, 2: 개수로 조회
|
||||||
objStockChart.SetInputValue(2, today) # 기간 조회 시, 시작일
|
objStockChart.SetInputValue(2, today) # 기간 조회 시, 시작일
|
||||||
@@ -468,7 +473,8 @@ class HTS:
|
|||||||
"low": [],
|
"low": [],
|
||||||
"vol": []}
|
"vol": []}
|
||||||
|
|
||||||
self.getCSV("./hts/" + stock_code + "_" + lastday + ".csv", today, result)
|
last_stock_filename = os.path.join(self.RESOURCE_PATH, "hts", stock_code + "_" + lastday + ".csv")
|
||||||
|
self.getCSV(last_stock_filename, today, result)
|
||||||
|
|
||||||
int_given_day = int(today)
|
int_given_day = int(today)
|
||||||
objCpCybos = win32com.client.Dispatch("CpUtil.CpCybos")
|
objCpCybos = win32com.client.Dispatch("CpUtil.CpCybos")
|
||||||
|
|||||||
Reference in New Issue
Block a user