This commit is contained in:
dsyoon
2023-10-16 12:26:52 +09:00
parent 149f3a45e2
commit 9459c98795
4 changed files with 10 additions and 7 deletions

View File

@@ -65,19 +65,19 @@ class HTS_etf(HTS):
if code == "A" + stock_code:
if bs_sell_price is not None:
if jangoDic[code]['매도가능'] > 0:
if jangoDic[code]['평가손익'] < -1.5 or 2 < jangoDic[code]['평가손익']:
if jangoDic[code]['평가손익'] < -1.5 or 1 < jangoDic[code]['평가손익']:
# 1.5% 손해 혹은 2% 이상 시 수익 매도
self.requestOrder(OrderType.sell, code[1:], jangoDic[code]['매도가능'], bs_sell_price)
check = True
else:
if jangoDic[code]['매도가능'] > 0:
if jangoDic[code]['평가손익'] < -1.5 or 2 < jangoDic[code]['평가손익']:
if jangoDic[code]['평가손익'] < -1.5 or 1 < jangoDic[code]['평가손익']:
# 1.5% 손해 혹은 2% 이상 시 수익 매도
self.requestOrder(OrderType.sell, code[1:], jangoDic[code]['매도가능'], jangoDic[code]['현재가'])
check = True
else:
if jangoDic[code]['매도가능'] > 0:
if jangoDic[code]['평가손익'] < -1.5 or 2 < jangoDic[code]['평가손익']:
if jangoDic[code]['평가손익'] < -1.5 or 1 < jangoDic[code]['평가손익']:
# 1.5% 손해 혹은 2% 이상 시 수익 매도
self.requestOrder(OrderType.sell, code[1:], jangoDic[code]['매도가능'], jangoDic[code]['현재가'])
check = True

View File

@@ -65,19 +65,19 @@ class HTS_etf(HTS):
if code == "A" + stock_code:
if bs_sell_price is not None:
if jangoDic[code]['매도가능'] > 0:
if jangoDic[code]['평가손익'] < -1.5 or 2 < jangoDic[code]['평가손익']:
if jangoDic[code]['평가손익'] < -1.5 or 1 < jangoDic[code]['평가손익']:
# 1.5% 손해 혹은 2% 이상 시 수익 매도
self.requestOrder(OrderType.sell, code[1:], jangoDic[code]['매도가능'], bs_sell_price)
check = True
else:
if jangoDic[code]['매도가능'] > 0:
if jangoDic[code]['평가손익'] < -1.5 or 2 < jangoDic[code]['평가손익']:
if jangoDic[code]['평가손익'] < -1.5 or 1 < jangoDic[code]['평가손익']:
# 1.5% 손해 혹은 2% 이상 시 수익 매도
self.requestOrder(OrderType.sell, code[1:], jangoDic[code]['매도가능'], jangoDic[code]['현재가'])
check = True
else:
if jangoDic[code]['매도가능'] > 0:
if jangoDic[code]['평가손익'] < -1.5 or 2 < jangoDic[code]['평가손익']:
if jangoDic[code]['평가손익'] < -1.5 or 1 < jangoDic[code]['평가손익']:
# 1.5% 손해 혹은 2% 이상 시 수익 매도
self.requestOrder(OrderType.sell, code[1:], jangoDic[code]['매도가능'], jangoDic[code]['현재가'])
check = True

View File

@@ -253,7 +253,9 @@ if __name__ == "__main__":
#"122630": ['20230930'],
#"122630": ['20210901','20210902','20210903','20210906','20231012','20231013']
#"122630": ['20210901', '20210902', '20210903', '20210906', '20210907', '20210908', '20210909', '20210910', '20210913', '20210914', '20210915', '20210916', '20210917', '20210923', '20210924', '20210927', '20210928', '20210929', '20210930', '20211001', '20211005','20231012','20231013'],
"252670": ['20231012', '20231013'],
"251340": ['20231012', '20231013'],
"122630": ['20231012', '20231013'],
"233740": ['20231012', '20231013'],
}
#simulation.simulate(stock_codes)

View File

@@ -415,7 +415,8 @@ class BuySellChecker:
last_index = size - 1
buy, buy_weight = self.getBuyPriceAndWeight(stock_code, last_index, data)
sell, sell_weight = self.getSellPriceAndWeight(stock_code, last_index, data)
#sell, sell_weight = self.getSellPriceAndWeight(stock_code, last_index, data)
sell, sell_weight = -1, -1
if data.index[last_index].strftime('%H:%M:%S') > datetime.strptime(datetime.today().strftime("%Y-%m-%d 15:10:00"), "%Y-%m-%d %H:%M:%S").strftime('%H:%M:%S'):
buy, buy_weight = -1, -1