This commit is contained in:
dsyoon
2022-02-04 12:08:03 +09:00
parent 579ff520c5
commit b72f6c0f55
4 changed files with 15 additions and 12 deletions

View File

@@ -208,15 +208,15 @@ class BuySellChecker:
if i < 40:
if data["low"][i] < data["lower"][i]+5:
if data["slow_k"][i] <= 20:
if data["slow_k"][i] < data["slow_k"][i-1] and data["slow_k"][i-1] < data["slow_k"][i]:
if data["slow_k"][i-1] < data["slow_d"][i-1] and data["slow_d"][i] < data["slow_k"][i] and data["slow_k"][i-1] <= data["slow_k"][i]:
if data["close"][i] < data["avg5"][i]:
buy = data["close"][i]
else:
buy = data["low"][i]
else:
if data["low"][i] < data["lower"][i]+5:
if data["slow_k"][i-1] <= 30 and data["slow_k"][i] <= 30:
if data["slow_k"][i] < data["slow_k"][i-1] and data["slow_k"][i-1] < data["slow_k"][i]:
if data["slow_k"][i-1] < 30 and data["slow_k"][i] < 30:
if data["slow_k"][i-1] < data["slow_d"][i-1] and data["slow_d"][i] < data["slow_k"][i] and data["slow_k"][i-1] <= data["slow_k"][i]:
if data["close"][i] < data["avg5"][i]:
buy = data["close"][i]
else:
@@ -366,7 +366,7 @@ class BuySellChecker:
'avg20': avg20[i], 'avg60': avg60[i], 'avg120': avg120[i],'avg240': avg240[i]})
# stochastic 계산
stochastic_df = self.stochastic.apply(STOCK)
stochastic_df = self.stochastic.apply(STOCK, n=12, m=5, t=5)
stochastic_df = stochastic_df.fillna(100)
fast_k = stochastic_df['fast_k'].values.tolist()
slow_k = stochastic_df['slow_k'].values.tolist()