init
This commit is contained in:
@@ -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
8
stock/util/LabelMaker.py
Normal file
@@ -0,0 +1,8 @@
|
||||
import sqlite3
|
||||
|
||||
class LabelMaker:
|
||||
def __init__(self):
|
||||
return
|
||||
|
||||
if __name__ == "__main__":
|
||||
labelMaker = LabelMaker()
|
||||
Reference in New Issue
Block a user