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 stock.util.Stock2Vector import Stock2Vector
from stock.util.LabelChecker import LabelChecker
from stock.util.StockPredictor import StockPredictor
from hts.BuySellChecker import BuySellChecker
from stock.analysis.StockStatus import StockStatus
class Simulation (HTS):
stock2Vector = None
buySellChecker = None
stockPredictor = None
def __init__(self, RESOURCE_PATH):
super().__init__(RESOURCE_PATH)
@@ -26,7 +24,6 @@ class Simulation (HTS):
try:
self.stock2Vector = Stock2Vector(RESOURCE_PATH)
self.labelChecker = LabelChecker(RESOURCE_PATH)
self.stockPredictor = StockPredictor(RESOURCE_PATH)
except:
pass
#self.connect()
@@ -36,7 +33,6 @@ class Simulation (HTS):
if bsLine is None:
return
bsLine = bsLine[stock_code]
# 어제 데이터는 지운다.
data = data.loc[pd.DatetimeIndex(data.index).day == int(given_day[6:])]
buy_line = bsLine['buy'][len(bsLine['buy'])-len(data):]
@@ -240,11 +236,11 @@ if __name__ == "__main__":
# to check bying
stock_codes = {
#"252670": ['20210924'],
"252670": ['20231012'],
"122630": ['20231012'],
#"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": ['20210916'],
#"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)