스토캐스틱, RSI 추가
This commit is contained in:
@@ -200,19 +200,21 @@ class BuySellChecker:
|
|||||||
### STOCHASTIC buy 분석 ###
|
### STOCHASTIC buy 분석 ###
|
||||||
##########################
|
##########################
|
||||||
if i < 40:
|
if i < 40:
|
||||||
if data["slow_k"][i] <= 20:
|
if data["Low"][i] - 3 < data["lower"][i]:
|
||||||
if data["slow_k"][i - 2] < data["slow_d"][i - 2] and data["slow_k"][i - 1] < data["slow_d"][i - 1] and data["slow_d"][i] < data["slow_k"][i]:
|
if data["slow_k"][i] <= 20:
|
||||||
if data["Close"][i] < data["avg5"][i]:
|
if data["slow_k"][i - 2] < data["slow_d"][i - 2] and data["slow_k"][i - 1] < data["slow_d"][i - 1] and data["slow_d"][i] < data["slow_k"][i]:
|
||||||
buy = data["Close"][i]
|
if data["Close"][i] < data["avg5"][i]:
|
||||||
else:
|
buy = data["Close"][i]
|
||||||
buy = data["Low"][i]
|
else:
|
||||||
|
buy = data["Low"][i]
|
||||||
else:
|
else:
|
||||||
if data["slow_k"][i] <= 35:
|
if data["Low"][i] - 3 < data["lower"][i]:
|
||||||
if data["slow_k"][i-2] < data["slow_d"][i-2] and data["slow_k"][i-1] < data["slow_d"][i-1] and data["slow_d"][i] < data["slow_k"][i]:
|
if data["slow_k"][i] <= 35:
|
||||||
if data["Close"][i] < data["avg5"][i]:
|
if data["slow_k"][i-2] < data["slow_d"][i-2] and data["slow_k"][i-1] < data["slow_d"][i-1] and data["slow_d"][i] < data["slow_k"][i]:
|
||||||
buy = data["Close"][i]
|
if data["Close"][i] < data["avg5"][i]:
|
||||||
else:
|
buy = data["Close"][i]
|
||||||
buy = data["Low"][i]
|
else:
|
||||||
|
buy = data["Low"][i]
|
||||||
|
|
||||||
#############################
|
#############################
|
||||||
### STOCHASTIC weight 분석 ###
|
### STOCHASTIC weight 분석 ###
|
||||||
|
|||||||
@@ -547,7 +547,7 @@ class HTS_252670:
|
|||||||
|
|
||||||
def buyRealTime(self, stock_code, GIVEN_DAY):
|
def buyRealTime(self, stock_code, GIVEN_DAY):
|
||||||
orderChecker = OrderChecker(stock_code)
|
orderChecker = OrderChecker(stock_code)
|
||||||
BASE_COUNT = 250
|
BASE_COUNT = 200
|
||||||
|
|
||||||
timecheckList = pd.read_csv("timecheck.csv").values.tolist()
|
timecheckList = pd.read_csv("timecheck.csv").values.tolist()
|
||||||
timecheck = {GIVEN_DAY + " " + str(second).zfill(6):False for second, check in timecheckList}
|
timecheck = {GIVEN_DAY + " " + str(second).zfill(6):False for second, check in timecheckList}
|
||||||
|
|||||||
@@ -172,11 +172,12 @@ if __name__ == "__main__":
|
|||||||
stock_codes = ["252670", "122630"]
|
stock_codes = ["252670", "122630"]
|
||||||
given_days = ['20210901','20210902','20210903','20210906','20210907','20210908','20210909','20210910','20210913',
|
given_days = ['20210901','20210902','20210903','20210906','20210907','20210908','20210909','20210910','20210913',
|
||||||
'20210914','20210915','20210916','20210917','20210923','20210924','20210927','20210928','20210929',
|
'20210914','20210915','20210916','20210917','20210923','20210924','20210927','20210928','20210929',
|
||||||
'20210930','20211001', '20211005','20211006', '20211007','20211008', '20211012','20211013', '20211014', '20211018']
|
'20210930','20211001', '20211005','20211006', '20211007','20211008', '20211012','20211013', '20211014',
|
||||||
|
'20211018', '20211019']
|
||||||
simulation = Simulation()
|
simulation = Simulation()
|
||||||
|
|
||||||
given_days = sorted(given_days, reverse=True)
|
given_days = sorted(given_days, reverse=True)
|
||||||
for given_day in given_days:
|
for given_day in given_days:
|
||||||
simulation.simulate(stock_codes[0], given_day)
|
simulation.simulate(stock_codes[1], given_day)
|
||||||
|
|
||||||
print ("done...")
|
print ("done...")
|
||||||
|
|||||||
Reference in New Issue
Block a user