This commit is contained in:
dsyoon
2023-01-26 01:17:28 +09:00
parent 6586034620
commit 1872669663

View File

@@ -120,7 +120,7 @@ class HTS_DAILY (HTS):
bsLine, data = self.buySellChecker.checkTransactionWithEnvelope(data, stock_code, self.analyzed_day, isRealTime=False)
# 다음 조건이면 매수한다.
if len(data.index) > 10 and max(bsLine['buy'][len(bsLine['buy']) - 2:]) > 1000 and not self.orderChecker.exist(stock_code):
if len(data.index) > 10 and max(bsLine['buy'][len(bsLine['buy']) - 1:]) > 1000 and not self.orderChecker.exist(stock_code):
last_index = len(bsLine['buy'])-1
if bsLine['buy'][last_index] > 0:
bs_buy_price = bsLine['buy'][last_index]
@@ -134,8 +134,9 @@ class HTS_DAILY (HTS):
# 로그 출력
print("BUY", THIS_TIME.strftime('%Y%m%d %H%M%S'), orderNum, stock_code, stock_name, bs_buy_price, buy_count)
"""
# 다음 조건이면 매도한다.
if len(data.index) > 10 and max(bsLine['sell'][len(bsLine['sell']) - 2:]) > 0:
if len(data.index) > 10 and max(bsLine['sell'][len(bsLine['sell']) - 1:]) > 0:
last_index = len(bsLine['sell']) - 1
if bsLine['sell'][last_index] > 0:
bs_sell_price = bsLine['sell'][last_index]
@@ -144,7 +145,7 @@ class HTS_DAILY (HTS):
# 로그 출력
print("SELL", THIS_TIME.strftime('%Y%m%d %H%M%S'), orderNum, stock_code, stock_name, bs_sell_price)
"""
THIS_TIME = datetime.now()
return