This commit is contained in:
dosangyoon
2021-10-21 20:38:34 +09:00
parent e1b8d147cb
commit 7e5b99f249
2 changed files with 9 additions and 3 deletions

View File

@@ -189,9 +189,15 @@ class BuySellChecker:
# 1. 볼린져밴드 상단이 최고와 종가 사이 아래에 있는 경우 매도한다.
if (data["High"][i] - data["Close"][i]) / 2 + data["Close"][i] > data["upper"][i]:
sell = data["High"][i]
"""
# 2. slow_k가 90이 넘으면 매도한다.
if data["slow_k"][i] >= 90:
sell = data["High"][i]
"""
if data["slow_k"][i] >= 85:
if data["slow_d"][i-1] < data["slow_k"][i-1] and data["slow_k"][i] < data["slow_d"][i]:
sell = data["High"][i]
# 3. 2시 이후에는 최고가가 볼린져밴드 상단 위에 있으면 매도한다.
if i > 300 and data["High"][i] > data["upper"][i]:
sell = data["High"][i]

View File

@@ -172,12 +172,12 @@ if __name__ == "__main__":
stock_codes = ["252670", "122630"]
given_days = ['20210901','20210902','20210903','20210906','20210907','20210908','20210909','20210910','20210913',
'20210914','20210915','20210916','20210917','20210923','20210924','20210927','20210928','20210929',
'20210930','20211001', '20211005','20211006', '20211007','20211008', '20211012','20211013', '20211014',
'20211018', '20211019']
'20210930','20211001','20211005','20211006','20211007','20211008','20211012','20211013','20211014',
'20211018', '20211019','20211020','20211021']
simulation = Simulation()
given_days = sorted(given_days, reverse=True)
for given_day in given_days:
simulation.simulate(stock_codes[1], given_day)
simulation.simulate(stock_codes[0], given_day)
print ("done...")