This commit is contained in:
dsyoon
2023-01-25 19:59:29 +09:00
parent e535c34718
commit 38e6bd7af0

View File

@@ -537,8 +537,8 @@ class Bithumb_minute(HTS):
return log_df
def check_buy_history(self, log_df, log_filename, hours=3):
now = datetime.now() - timedelta(hours=hours)
def check_buy_history(self, log_df, log_filename, min=10):
now = datetime.now() - timedelta(minutes=min)
log_df = log_df.loc[(now < log_df.index)]
if len(log_df) == 0:
@@ -620,7 +620,8 @@ class Bithumb_minute(HTS):
# 10분이 지난 미체결은 취소한다.
order_log_df = self.cancel_order(order_log_df, order_log_filename, min=10)
buy_history, buy_history_df = self.check_buy_history(buy_history_df, buy_history_filename, hours=3)
# 한번 매수 후 n분 이후 매수하기 위함
buy_history, buy_history_df = self.check_buy_history(buy_history_df, buy_history_filename, min=10)
if isRealTime and not buy_history:
if max(bsLine['buy'][len(bsLine['buy']) - 2:]) > 100:
tmp = self.bithumb.get_balance(ticker)
@@ -643,7 +644,7 @@ class Bithumb_minute(HTS):
order_log_df['datetime'] = order_log_df.index
order_log_df.to_csv(order_log_filename, index=False)
# 한번 매수 후 n시간 이후 매수하기 위함
# 한번 매수 후 n 이후 매수하기 위함
indexes2 = buy_history_df.index.tolist()
indexes2.append(datetime_value)