This commit is contained in:
dsyoon
2023-10-12 23:01:59 +09:00
parent 9c6ab45d87
commit bef7240941

View File

@@ -7,14 +7,12 @@ import os
from hts.HTS import HTS from hts.HTS import HTS
from stock.util.Stock2Vector import Stock2Vector from stock.util.Stock2Vector import Stock2Vector
from stock.util.LabelChecker import LabelChecker from stock.util.LabelChecker import LabelChecker
from stock.util.StockPredictor import StockPredictor
from hts.BuySellChecker import BuySellChecker from hts.BuySellChecker import BuySellChecker
from stock.analysis.StockStatus import StockStatus from stock.analysis.StockStatus import StockStatus
class Simulation (HTS): class Simulation (HTS):
stock2Vector = None stock2Vector = None
buySellChecker = None buySellChecker = None
stockPredictor = None
def __init__(self, RESOURCE_PATH): def __init__(self, RESOURCE_PATH):
super().__init__(RESOURCE_PATH) super().__init__(RESOURCE_PATH)
@@ -26,7 +24,6 @@ class Simulation (HTS):
try: try:
self.stock2Vector = Stock2Vector(RESOURCE_PATH) self.stock2Vector = Stock2Vector(RESOURCE_PATH)
self.labelChecker = LabelChecker(RESOURCE_PATH) self.labelChecker = LabelChecker(RESOURCE_PATH)
self.stockPredictor = StockPredictor(RESOURCE_PATH)
except: except:
pass pass
#self.connect() #self.connect()
@@ -36,7 +33,6 @@ class Simulation (HTS):
if bsLine is None: if bsLine is None:
return return
bsLine = bsLine[stock_code]
# 어제 데이터는 지운다. # 어제 데이터는 지운다.
data = data.loc[pd.DatetimeIndex(data.index).day == int(given_day[6:])] data = data.loc[pd.DatetimeIndex(data.index).day == int(given_day[6:])]
buy_line = bsLine['buy'][len(bsLine['buy'])-len(data):] buy_line = bsLine['buy'][len(bsLine['buy'])-len(data):]
@@ -240,11 +236,11 @@ if __name__ == "__main__":
# to check bying # to check bying
stock_codes = { stock_codes = {
#"252670": ['20210924'], "252670": ['20231012'],
"122630": ['20231012'],
#"252670": ['20210901','20210902','20210903','20210906'], #"252670": ['20210901','20210902','20210903','20210906'],
"252670": ['20210901', '20210902', '20210903', '20210906', '20210907', '20210908', '20210909', '20210910', '20210913', '20210914', '20210915', '20210916', '20210917', '20210923', '20210924', '20210927', '20210928', '20210929', '20210930', '20211001', '20211005'], #"252670": ['20210901', '20210902', '20210903', '20210906', '20210907', '20210908', '20210909', '20210910', '20210913', '20210914', '20210915', '20210916', '20210917', '20210923', '20210924', '20210927', '20210928', '20210929', '20210930', '20211001', '20211005'],
#"122630": ['20220901', '20220902', '20220905', '20220906'] #"122630": ['20220901', '20220902', '20220905', '20220906']
#"122630": ['20210916'],
#"122630": ['20210901', '20210902', '20210903', '20210906', '20210907', '20210908', '20210909', '20210910', '20210913', '20210914', '20210915', '20210916', '20210917', '20210923', '20210924', '20210927', '20210928', '20210929', '20210930', '20211001', '20211005'], #"122630": ['20210901', '20210902', '20210903', '20210906', '20210907', '20210908', '20210909', '20210910', '20210913', '20210914', '20210915', '20210916', '20210917', '20210923', '20210924', '20210927', '20210928', '20210929', '20210930', '20211001', '20211005'],
} }
#simulation.simulate(stock_codes) #simulation.simulate(stock_codes)