This commit is contained in:
dsyoon
2023-10-09 22:09:32 +09:00
parent 4736baa915
commit 2a07a431f3
3 changed files with 154 additions and 110 deletions

View File

@@ -122,9 +122,9 @@ class Simulation (HTS):
rsi_line = go.Scatter(x=data['date'], y=data["rsi"], line=dict(color='red', width=2), name='rsi')
rsis_line = go.Scatter(x=data['date'], y=data["rsis"], line=dict(dash='dashdot', color='black', width=2), name='rsis')
#candle_data = [candle_stick, upper, lower, avg5, avg20, avg30, avg60, avg120, avg200, buy_check, sell_check, laggingSpan, changeLine, baseLine]
candle_data = [candle_stick, upper, lower, avg5, avg20, avg30, avg60, avg120, avg200, buy_check, sell_check, laggingSpan, changeLine, baseLine]
candle_data = [candle_stick, avg5, avg20, avg30, avg60, avg200, buy_check, sell_check]
#candle_data = [candle_stick, buy_check, sell_check]
candle_data = [candle_stick, avg200, buy_check, sell_check]
volume_data = [volume_line]
disparity_data = [disparity_avg5, disparity_avg20, disparity_avg30, disparity_avg60, disparity_avg120, disparity_avg200]
macd_data = [macd_line, macd_s_line, macd_o_line]
@@ -140,20 +140,20 @@ class Simulation (HTS):
fig = subplots.make_subplots(
rows=6, cols=1,
subplot_titles=("MACD", "스토캐스틱", "RSI", "거래량", "이격도", '캔들'),
subplot_titles=("거래량", "이격도", "스토캐스틱", "RSI", "MACD", '캔들'),
#specs=[[{}], [{}], [{}], [{}], [{}], [{}]],
shared_xaxes=True, horizontal_spacing=0.03, vertical_spacing=0.01,
row_heights=[200, 200, 200, 200, 200, 700]
)
for trace in macd_data:
fig.append_trace(trace, 1, 1)
for trace in stochastic_data:
fig.append_trace(trace, 2, 1)
for trace in rsi_data:
fig.append_trace(trace, 3, 1)
for trace in volume_data:
fig.append_trace(trace, 4, 1)
fig.append_trace(trace, 1, 1)
for trace in disparity_data:
fig.append_trace(trace, 2, 1)
for trace in stochastic_data:
fig.append_trace(trace, 3, 1)
for trace in rsi_data:
fig.append_trace(trace, 4, 1)
for trace in macd_data:
fig.append_trace(trace, 5, 1)
for trace in candle_data:
fig.append_trace(trace, 6, 1)
@@ -240,8 +240,12 @@ if __name__ == "__main__":
# to check bying
stock_codes = {
"252670": ['20220906'],
#"252670": ['20210924'],
#"252670": ['20210901','20210902','20210903','20210906'],
#"252670": ['20210901', '20210902', '20210903', '20210906', '20210907', '20210908', '20210909', '20210910', '20210913', '20210914', '20210915', '20210916', '20210917', '20210923', '20210924', '20210927', '20210928', '20210929', '20210930', '20211001', '20211005'],
#"122630": ['20220901', '20220902', '20220905', '20220906']
#"122630": ['20210916'],
"122630": ['20210901', '20210902', '20210903', '20210906', '20210907', '20210908', '20210909', '20210910', '20210913', '20210914', '20210915', '20210916', '20210917', '20210923', '20210924', '20210927', '20210928', '20210929', '20210930', '20211001', '20211005'],
}
#simulation.simulate(stock_codes)
simulation.simulate(stock_codes)