init
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import time
|
||||
import numpy as np
|
||||
from math import nan
|
||||
import pandas as pd
|
||||
import plotly.graph_objects as go
|
||||
@@ -152,9 +152,9 @@ class Simulation (HTS):
|
||||
self.labelMaker.showLabels(stock_code, today)
|
||||
else:
|
||||
if method == "ml":
|
||||
LAST_DATA = self.stock2Vector.getLastData(stock_code, today, n=1)
|
||||
LAST_DATA = self.stock2Vector.getLastData(stock_code, today, n=3)
|
||||
data = self.stock2Vector.getRealTime(stock_code, today, LAST_DATA)
|
||||
X, Y = self.stock2Vector.getDataset2D(data)
|
||||
X, Y = self.stock2Vector.getVectorData(data)
|
||||
|
||||
predY = self.stockPredictor.predict(X, Y)
|
||||
bsLine = None
|
||||
@@ -180,11 +180,11 @@ if __name__ == "__main__":
|
||||
|
||||
# to check bying
|
||||
stock_codes = {
|
||||
"252670": ['20220801', '20220802', '20220803', '20220804', '20220805', '20220808', '20220809', '20220810', '20220811'],
|
||||
"122630": ['20220801', '20220802', '20220803', '20220804', '20220805', '20220808', '20220809', '20220810', '20220811'],
|
||||
"252670": ['20220805', '20220808', '20220809', '20220810', '20220811'],
|
||||
"122630": ['20220805', '20220808', '20220809', '20220810', '20220811'],
|
||||
}
|
||||
|
||||
method = "rule" # "rule", "ml", "answer"
|
||||
method = "ml" # "rule", "ml", "answer"
|
||||
for stock_code in stock_codes:
|
||||
simulation = Simulation(RESOURCE_PATH)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user