This commit is contained in:
dsyoon
2022-08-02 13:10:37 +09:00
parent b94f2ff01a
commit 8d1c4ae041
2 changed files with 25 additions and 8 deletions

View File

@@ -3,6 +3,7 @@ import pandas as pd
import plotly.graph_objects as go
from plotly import subplots
import os
import sqlite3
from hts.HTS import HTS
from stock.util.Stock2Vector import Stock2Vector
@@ -126,19 +127,27 @@ class Simulation (HTS):
return
def simulate(self, stock_code, today):
def getData(self):
return
def simulate(self, stock_code, today, type="rule"):
LAST_DATA = self.stock2Vector.getLastData(stock_code, today)
result = self.stock2Vector.getRealTime(stock_code, today, LAST_DATA)
# 규칙 기반의 분석을 통해서 볼린저밴드 상/하단을 계산한다.
data = self.buySellChecker.analyzeByRule(result)
if type == "rule":
# 규칙 기반의 분석을 통해서 볼린저밴드 상/하단을 계산한다.
data = self.buySellChecker.analyzeByRule(result)
# 사야 할 시점과 팔아야 할 시점을 체크한다.
bsLine, data = self.buySellChecker.checkTransaction(data, stock_code, False)
elif type == "labeltest":
data = self.getData(result)
else:
data = None
# 사야 할 시점과 팔아야 할 시점을 체크한다.
bsLine, data = self.buySellChecker.checkTransaction(data, stock_code, False)
# 그래프를 그린다.
self.draw(stock_code, today, data, bsLine)
if data is not None:
# 그래프를 그린다.
self.draw(stock_code, today, data, bsLine)
return

8
stock/util/LabelMaker.py Normal file
View File

@@ -0,0 +1,8 @@
import sqlite3
class LabelMaker:
def __init__(self):
return
if __name__ == "__main__":
labelMaker = LabelMaker()