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