init
This commit is contained in:
@@ -18,7 +18,7 @@ class HTS_122630 (HTS):
|
||||
buySellChecker = None
|
||||
|
||||
def __init__(self, RESOURCE_PATH, stock_code, buy_count):
|
||||
super().__init__()
|
||||
super().__init__(RESOURCE_PATH)
|
||||
|
||||
self.RESOURCE_PATH = RESOURCE_PATH
|
||||
self.stock_code = stock_code
|
||||
|
||||
12
hts/HTS.py
12
hts/HTS.py
@@ -1,3 +1,5 @@
|
||||
import os.path
|
||||
|
||||
import win32com.client
|
||||
import csv
|
||||
import time
|
||||
@@ -8,8 +10,10 @@ class HTS:
|
||||
|
||||
objCpCybos = None
|
||||
objCpCodeMgr = None
|
||||
RESOURCE_PATH = None
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self, RESOURCE_PATH):
|
||||
self.RESOURCE_PATH = RESOURCE_PATH
|
||||
#self.connect()
|
||||
return
|
||||
|
||||
@@ -383,7 +387,8 @@ class HTS:
|
||||
# 차트 객체 구하기
|
||||
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(1, ord('1')) # 1: 기간으로 조회, 2: 개수로 조회
|
||||
objStockChart.SetInputValue(2, today) # 기간 조회 시, 시작일
|
||||
@@ -468,7 +473,8 @@ class HTS:
|
||||
"low": [],
|
||||
"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)
|
||||
objCpCybos = win32com.client.Dispatch("CpUtil.CpCybos")
|
||||
|
||||
Reference in New Issue
Block a user