init
This commit is contained in:
@@ -366,14 +366,14 @@ class BuySellChecker:
|
||||
'avg20': avg20[i], 'avg60': avg60[i], 'avg120': avg120[i],'avg240': avg240[i]})
|
||||
|
||||
# stochastic 계산
|
||||
stochastic_df = self.stochastic.apply(pd.DataFrame(STOCK))
|
||||
stochastic_df = self.stochastic.apply(STOCK)
|
||||
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()
|
||||
|
||||
# rsi 계산
|
||||
rsi_df = self.rsi.apply(pd.DataFrame(STOCK))
|
||||
rsi_df = self.rsi.apply(STOCK)
|
||||
rsi_df = rsi_df.fillna(100)
|
||||
rsi = rsi_df['rsi'].values.tolist()
|
||||
rsis = rsi_df['rsis'].values.tolist()
|
||||
|
||||
@@ -18,6 +18,8 @@ class RSI:
|
||||
return
|
||||
|
||||
def apply(sefl, df, period=10):
|
||||
df = pd.DataFrame(df)
|
||||
|
||||
# df.diff를 통해 (기준일 종가 - 기준일 전일 종가)를 계산하여 0보다 크면 증가분을 감소했으면 0을 넣어줌
|
||||
U = np.where(df.close.diff(1) > 0, df.close.diff(1), 0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user