init
This commit is contained in:
@@ -42,7 +42,7 @@ class Simulation:
|
||||
return
|
||||
|
||||
def checkTransaction(self, data):
|
||||
size = len(data["Close"])
|
||||
size = len(data["close"])
|
||||
|
||||
bsLine = {}
|
||||
bsLine['buy'] = [-1 for i in range(size)]
|
||||
@@ -62,11 +62,11 @@ class Simulation:
|
||||
sell_line = bsLine['sell']
|
||||
|
||||
# 그래프 설정을 위한 변수를 생성한다.
|
||||
data['Open'] = pd.to_numeric(data['Open'])
|
||||
data['High'] = pd.to_numeric(data['High'])
|
||||
data['Low'] = pd.to_numeric(data['Low'])
|
||||
data['Close'] = pd.to_numeric(data['Close'])
|
||||
data['Volume'] = pd.to_numeric(data['Volume'])
|
||||
data['open'] = pd.to_numeric(data['open'])
|
||||
data['high'] = pd.to_numeric(data['high'])
|
||||
data['low'] = pd.to_numeric(data['low'])
|
||||
data['close'] = pd.to_numeric(data['close'])
|
||||
data['volume'] = pd.to_numeric(data['volume'])
|
||||
data['avg5'] = pd.to_numeric(data['avg5'])
|
||||
data["fast_k"] = pd.to_numeric(data['fast_k'])
|
||||
data["slow_k"] = pd.to_numeric(data['slow_k'])
|
||||
@@ -90,19 +90,19 @@ class Simulation:
|
||||
sell_colors.append("#00ced1")
|
||||
|
||||
# 그래프를 설정한다.
|
||||
buy_check = go.Scatter(x=data['Date'], y=buy_line, mode='markers', name="buy", marker=dict(size=14, color=buy_colors, line_width=0))
|
||||
sell_check = go.Scatter(x=data['Date'], y=sell_line, mode='markers', name="sell", marker=dict(size=14, color=sell_colors, line_width=0))
|
||||
bolinger_upper = go.Scatter(x=data['Date'], y=data["upper"], name="upper", line_color='#8B4513')
|
||||
bolinger_lower = go.Scatter(x=data['Date'], y=data["lower"], name="lower", line_color='#8B4513')
|
||||
avg5 = go.Scatter(x=data['Date'], y=data["avg5"], name="avg5", line_color='#000000')
|
||||
buy_check = go.Scatter(x=data['date'], y=buy_line, mode='markers', name="buy", marker=dict(size=14, color=buy_colors, line_width=0))
|
||||
sell_check = go.Scatter(x=data['date'], y=sell_line, mode='markers', name="sell", marker=dict(size=14, color=sell_colors, line_width=0))
|
||||
bolinger_upper = go.Scatter(x=data['date'], y=data["upper"], name="upper", line_color='#8B4513')
|
||||
bolinger_lower = go.Scatter(x=data['date'], y=data["lower"], name="lower", line_color='#8B4513')
|
||||
avg5 = go.Scatter(x=data['date'], y=data["avg5"], name="avg5", line_color='#000000')
|
||||
|
||||
candle_stick = go.Candlestick(x=data['Date'], open=data['Open'], high=data['High'], low=data['Low'], close=data['Close'], increasing_line_color='red', decreasing_line_color='blue')
|
||||
volume_line = go.Scatter(x=data['Date'], y=data["Volume"], mode='lines', name='Volume')
|
||||
fast_k_line = go.Scatter(x=data['Date'], y=data["fast_k"], mode='lines', name='fast_k')
|
||||
slow_k_line = go.Scatter(x=data['Date'], y=data["slow_k"], mode='lines', name='slow_k')
|
||||
slow_d_line = go.Scatter(x=data['Date'], y=data["slow_d"], mode='lines', name='slow_d')
|
||||
rsi_line = go.Scatter(x=data['Date'], y=data["rsi"], mode='lines', name='rsi')
|
||||
rsis_line = go.Scatter(x=data['Date'], y=data["rsis"], mode='lines', name='rsis')
|
||||
candle_stick = go.Candlestick(x=data['date'], open=data['open'], high=data['high'], low=data['low'], close=data['close'], increasing_line_color='red', decreasing_line_color='blue')
|
||||
volume_line = go.Scatter(x=data['date'], y=data["volume"], mode='lines', name='volume')
|
||||
fast_k_line = go.Scatter(x=data['date'], y=data["fast_k"], mode='lines', name='fast_k')
|
||||
slow_k_line = go.Scatter(x=data['date'], y=data["slow_k"], mode='lines', name='slow_k')
|
||||
slow_d_line = go.Scatter(x=data['date'], y=data["slow_d"], mode='lines', name='slow_d')
|
||||
rsi_line = go.Scatter(x=data['date'], y=data["rsi"], mode='lines', name='rsi')
|
||||
rsis_line = go.Scatter(x=data['date'], y=data["rsis"], mode='lines', name='rsis')
|
||||
|
||||
#candle_data = [candle_stick, bolinger_upper, bolinger_lower, buy_check, sell_check, avg1, avg2, avg5, avg10, avg20, avg30, avg40, avg50, avg60]
|
||||
candle_data = [candle_stick, bolinger_upper, bolinger_lower, avg5, buy_check, sell_check]
|
||||
@@ -174,6 +174,7 @@ if __name__ == "__main__":
|
||||
'20210914','20210915','20210916','20210917','20210923','20210924','20210927','20210928','20210929',
|
||||
'20210930','20211001','20211005','20211006','20211007','20211008','20211012','20211013','20211014',
|
||||
'20211018', '20211019','20211020','20211021','20211022']
|
||||
given_days = ['20211022']
|
||||
|
||||
simulation = Simulation()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user