init
This commit is contained in:
@@ -38,9 +38,8 @@ class Simulation (HTS):
|
||||
# 어제 데이터는 지운다.
|
||||
data = data.loc[pd.DatetimeIndex(data.index).day == int(given_day[6:])]
|
||||
buy_line = bsLine['buy'][381:]
|
||||
buy_weight_line = bsLine['buy_weight'][381:]
|
||||
sell_line = bsLine['sell'][381:]
|
||||
#buy_line = bsLine['buy']
|
||||
#sell_line = bsLine['sell']
|
||||
|
||||
# 그래프 설정을 위한 변수를 생성한다.
|
||||
data = data.astype({'open': 'int',
|
||||
@@ -61,13 +60,17 @@ class Simulation (HTS):
|
||||
'rsis': 'float'
|
||||
})
|
||||
|
||||
buy_size = []
|
||||
buy_colors = []
|
||||
for i in range(len(buy_line)):
|
||||
if buy_line[i] < 0:
|
||||
buy_colors.append("#ffffff")
|
||||
buy_line[i] = nan
|
||||
buy_size.append(0)
|
||||
else:
|
||||
buy_colors.append("#ff00ff")
|
||||
buy_colors.append("#DA8913")
|
||||
buy_size.append(10 + (5 * buy_weight_line[i]))
|
||||
|
||||
sell_colors = []
|
||||
for i in range(len(sell_line)):
|
||||
if sell_line[i] < 0:
|
||||
@@ -77,7 +80,7 @@ class Simulation (HTS):
|
||||
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))
|
||||
buy_check = go.Scatter(x=data['date'], y=buy_line, mode='markers', name="buy", marker=dict(size=buy_size, 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))
|
||||
upper = go.Scatter(x=data['date'], y=data["upper"], name="upper", line_color='#000000')
|
||||
lower = go.Scatter(x=data['date'], y=data["lower"], name="lower", line_color='#000000')
|
||||
@@ -175,8 +178,8 @@ if __name__ == "__main__":
|
||||
|
||||
# to check bying
|
||||
stock_codes = {
|
||||
"122630": ['20220801', '20220802', '20220803', '20220804', '20220805'],
|
||||
"252670": ['20220801', '20220802', '20220803', '20220804', '20220805'],
|
||||
"252670": ['20220801', '20220802', '20220803', '20220804', '20220805', '20220808', '20220809', '20220810', '20220811'],
|
||||
#"122630": ['20220810'],
|
||||
}
|
||||
|
||||
method = "rule" # "rule", "ml", "answer"
|
||||
|
||||
Reference in New Issue
Block a user