init
This commit is contained in:
@@ -287,9 +287,7 @@ class BS:
|
||||
|
||||
# stochastic 계산
|
||||
stochastic_df = self.stochastic.apply(pd.DataFrame(STOCK))
|
||||
stochastic_df['fast_k'] = stochastic_df['fast_k'].fillna(float(stochastic_df['fast_k'].iloc[9]))
|
||||
stochastic_df['slow_k'] = stochastic_df['slow_k'].fillna(float(stochastic_df['slow_k'].iloc[14]))
|
||||
stochastic_df['slow_d'] = stochastic_df['slow_d'].fillna(float(stochastic_df['slow_d'].iloc[19]))
|
||||
stochastic_df = stochastic_df.fillna(100)
|
||||
fast_k = stochastic_df['fast_k'].values.tolist()
|
||||
slow_k = stochastic_df['slow_k'].values.tolist()
|
||||
slow_d = stochastic_df['slow_d'].values.tolist()
|
||||
|
||||
@@ -582,7 +582,6 @@ class HTS:
|
||||
|
||||
if datetime.strptime(given_day + " 090100", '%Y%m%d %H%M%S') < datetime.now() < datetime.strptime(given_day + " 151000", '%Y%m%d %H%M%S'):
|
||||
if second in timecheck and not timecheck[second]:
|
||||
print("TIMECHECK", second)
|
||||
|
||||
# 데이터를 가지고 온다.
|
||||
self.getRealTime(stock_code, given_day, result)
|
||||
@@ -591,7 +590,8 @@ class HTS:
|
||||
data = self.bs.analyze(result)
|
||||
# 사야 할 시점/가격과 팔아야 할 시점/가격을 체크한다.
|
||||
bs_buy_price, bs_weight, bs_sell_price = self.checkTransaction(data)
|
||||
final_price = data["Close"][len(data["Close"])-1]
|
||||
data_size = len(data["Close"])
|
||||
final_price = data["Close"][data_size-1]
|
||||
|
||||
if bs_buy_price > 0:
|
||||
BUY_COUNT = int(200 * bs_weight)
|
||||
@@ -610,6 +610,7 @@ class HTS:
|
||||
self.requestOrder("1", stock_code, selling_count, selling_price)
|
||||
print("SELL", second, selling_count, selling_price)
|
||||
|
||||
print("TIMECHECK", second, final_price, data["Low"][data_size-1], data["slow_k"][data_size-1], data["slow_d"][data_size-1])
|
||||
timecheck[second] = True
|
||||
|
||||
if datetime.strptime(given_day + " 151000", '%Y%m%d %H%M%S') < datetime.now():
|
||||
|
||||
Reference in New Issue
Block a user