This commit is contained in:
dsyoon
2022-08-05 00:58:56 +09:00
parent 53d9274277
commit a3e390ab70
2 changed files with 7 additions and 2 deletions

View File

@@ -7,6 +7,7 @@ import os
from hts.HTS import HTS
from stock.util.Stock2Vector import Stock2Vector
from stock.util.StockPredictor import StockPredictor
from stock.util.LabelMaker import LabelMaker
from hts.BuySellChecker import BuySellChecker
class Simulation (HTS):
@@ -17,6 +18,7 @@ class Simulation (HTS):
super().__init__(RESOURCE_PATH)
self.stock2Vector = Stock2Vector(RESOURCE_PATH)
self.labelMaker = LabelMaker(RESOURCE_PATH)
self.stockPredictor = StockPredictor()
self.buySellChecker = BuySellChecker()
self.RESOURCE_PATH = RESOURCE_PATH
@@ -131,7 +133,10 @@ class Simulation (HTS):
def simulate(self, stock_code, today, method="rule"):
if method == "ml":
if method == "answer":
bsLine, data = self.labelMaker.makeCandidate(stock_code, today, view=True)
elif method == "ml":
LAST_DATA = self.stock2Vector.getLastData(stock_code, today, n=10)
result = self.stock2Vector.getRealTime(stock_code, today, LAST_DATA)

View File

@@ -253,7 +253,7 @@ class LabelMaker (HTS):
data = self.buySellChecker.analyze(result)
bsLine, data = self.checkTransaction(data)
self.writeLabelFile(stock_code, bsLine, data, ymd)
#self.writeLabelFile(stock_code, bsLine, data, ymd)
if view:
self.draw_simple(stock_code, ymd, data, bsLine)
#self.draw_detail(stock_code, ymd, data, bsLine)