This commit is contained in:
dsyoon
2023-10-09 22:45:45 +09:00
parent 2a07a431f3
commit 522a5ff449
2 changed files with 35 additions and 34 deletions

View File

@@ -242,10 +242,10 @@ if __name__ == "__main__":
stock_codes = { stock_codes = {
#"252670": ['20210924'], #"252670": ['20210924'],
#"252670": ['20210901','20210902','20210903','20210906'], #"252670": ['20210901','20210902','20210903','20210906'],
#"252670": ['20210901', '20210902', '20210903', '20210906', '20210907', '20210908', '20210909', '20210910', '20210913', '20210914', '20210915', '20210916', '20210917', '20210923', '20210924', '20210927', '20210928', '20210929', '20210930', '20211001', '20211005'], "252670": ['20210901', '20210902', '20210903', '20210906', '20210907', '20210908', '20210909', '20210910', '20210913', '20210914', '20210915', '20210916', '20210917', '20210923', '20210924', '20210927', '20210928', '20210929', '20210930', '20211001', '20211005'],
#"122630": ['20220901', '20220902', '20220905', '20220906'] #"122630": ['20220901', '20220902', '20220905', '20220906']
#"122630": ['20210916'], #"122630": ['20210916'],
"122630": ['20210901', '20210902', '20210903', '20210906', '20210907', '20210908', '20210909', '20210910', '20210913', '20210914', '20210915', '20210916', '20210917', '20210923', '20210924', '20210927', '20210928', '20210929', '20210930', '20211001', '20211005'], #"122630": ['20210901', '20210902', '20210903', '20210906', '20210907', '20210908', '20210909', '20210910', '20210913', '20210914', '20210915', '20210916', '20210917', '20210923', '20210924', '20210927', '20210928', '20210929', '20210930', '20211001', '20211005'],
} }
#simulation.simulate(stock_codes) #simulation.simulate(stock_codes)
simulation.simulate(stock_codes) simulation.simulate(stock_codes)

View File

@@ -124,38 +124,6 @@ class BuySellChecker:
return False return False
def getBuyPriceAndWeight_252670(self, i, data):
buy, weight = -1, -1
if i > 50:
up, down = 0, 0
for idx in range(i, i - (300 + 1), -1):
if data['avg200'][idx-1] < data['avg200'][idx]:
up += 1
if data['avg200'][idx-1] > data['avg200'][idx]:
down += 1
if up < down:
if max(data['avg200'][i-20:i])+0.05 < data['avg200'][i]:
buy = data['close'][i]
weight = 0.3
up, down = 0, 0
for idx in range(i, i - (10 + 1), -1):
if data['close'][idx-1] < data['close'][idx]:
up += 1
elif data['close'][idx - 1] > data['close'][idx]:
down += 1
if down < up:
buy, weight = -1, -1
if data['close'][i] < data['avg200'][i] or data['avg200'][i] + 10 < data['close'][i]:
buy, weight = -1, -1
if 2 < data['macd'][i]:
buy, weight = -1, -1
return buy, weight
def getBuyPriceAndWeight_122630(self, i, data): def getBuyPriceAndWeight_122630(self, i, data):
buy, weight = -1, -1 buy, weight = -1, -1
@@ -215,6 +183,39 @@ class BuySellChecker:
return buy, weight return buy, weight
def getBuyPriceAndWeight_252670(self, i, data):
buy, weight = -1, -1
if i > 50:
up, down = 0, 0
for idx in range(i, i - (300 + 1), -1):
if data['avg200'][idx-1] < data['avg200'][idx]:
up += 1
if data['avg200'][idx-1] > data['avg200'][idx]:
down += 1
if up < down:
if max(data['avg200'][i-20:i])+0.05 < data['avg200'][i]:
buy = data['close'][i]
weight = 0.3
up, down = 0, 0
for idx in range(i, i - (10 + 1), -1):
if data['close'][idx-1] < data['close'][idx]:
up += 1
elif data['close'][idx - 1] > data['close'][idx]:
down += 1
if down < up:
buy, weight = -1, -1
if data['close'][i] < data['avg200'][i] or data['avg200'][i] + 10 < data['close'][i]:
buy, weight = -1, -1
if 2 < data['macd'][i]:
buy, weight = -1, -1
return buy, weight
def getSellPriceAndWeight(self, i, data): def getSellPriceAndWeight(self, i, data):
sell, weight = -1, -1 sell, weight = -1, -1