This commit is contained in:
dosangyoon
2022-08-16 21:23:40 +09:00
parent f9ffa363fa
commit 1eed2ea40e
6 changed files with 435 additions and 951 deletions

View File

@@ -52,9 +52,8 @@ class Simulation (HTS):
'avg6': 'float',
'avg9': 'float',
'avg12': 'float',
'avg24': 'float',
'avg30': 'float',
'avg60': 'float',
'avg27': 'float',
'avg54': 'float',
'fast_k': 'float',
'slow_k': 'float',
'slow_d': 'float',
@@ -70,7 +69,7 @@ class Simulation (HTS):
buy_line[i] = nan
buy_size.append(0)
else:
buy_colors.append("#D87D0F")
buy_colors.append("#B2028C")
buy_size.append(10 + (5 * buy_weight_line[i]))
sell_colors = []
@@ -90,8 +89,8 @@ class Simulation (HTS):
avg6 = go.Scatter(x=data['date'], y=data["avg6"], name="avg6", line_color='#089B5B')
avg9 = go.Scatter(x=data['date'], y=data["avg9"], name="avg9", line_color='#ff00ff')
avg12 = go.Scatter(x=data['date'], y=data["avg12"], name="avg12", line_color='#1469F4')
avg24 = go.Scatter(x=data['date'], y=data["avg24"], name="avg24", line_color='#000000')
avg30 = go.Scatter(x=data['date'], y=data["avg30"], name="avg30", line_color='#008000')
avg27 = go.Scatter(x=data['date'], y=data["avg27"], name="avg27", line_color='#000000')
avg54 = go.Scatter(x=data['date'], y=data["avg54"], name="avg54", line_color='#008000')
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')
@@ -107,7 +106,7 @@ class Simulation (HTS):
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, upper, lower, avg3, avg6, avg9, avg12, avg24, avg30, buy_check, sell_check]
candle_data = [candle_stick, upper, lower, avg3, avg6, avg9, avg12, avg27, avg54, buy_check, sell_check]
volume_data = [volume_line]
macd_data = [macd_line, macd_s_line, macd_o_line]
stochastic_data = [slow_k_line, slow_d_line]
@@ -180,11 +179,11 @@ if __name__ == "__main__":
# to check bying
stock_codes = {
"252670": ['20220805', '20220808', '20220809', '20220810', '20220811'],
"122630": ['20220805', '20220808', '20220809', '20220810', '20220811'],
#"252670": ['20220801', '20220802', '20220803', '20220804', '20220805', '20220808', '20220809', '20220810', '20220811', '20220812'],
"122630": ['20220801', '20220802', '20220803', '20220804', '20220805', '20220808', '20220809', '20220810', '20220811', '20220812'],
}
method = "ml" # "rule", "ml", "answer"
method = "rule" # "rule", "ml", "answer"
for stock_code in stock_codes:
simulation = Simulation(RESOURCE_PATH)