init
This commit is contained in:
@@ -498,7 +498,8 @@ def monitor_coins():
|
||||
if recent_data['buy_point'].iloc[-1] != 1:
|
||||
continue
|
||||
print(f" - {KR_COINS[symbol]} ({symbol}): {recent_data['Close'].iloc[-1]:.2f}")
|
||||
message_list.append(format_message('COIN', symbol, KR_COINS[symbol], recent_data['Close'].iloc[-1], recent_data['buy_signal'].iloc[-1]))
|
||||
pool = Pool(12)
|
||||
pool.map(send_coin_msg, ["[KRW-COIN]" + "\n" + format_message('COIN', symbol, KR_COINS[symbol], recent_data['Close'].iloc[-1], recent_data['buy_signal'].iloc[-1])])
|
||||
|
||||
# buy
|
||||
buy_success = buy_ticker(symbol, recent_data)
|
||||
@@ -511,18 +512,11 @@ def monitor_coins():
|
||||
print(f"Data for {symbol} is empty or None.")
|
||||
time.sleep(0.5)
|
||||
|
||||
if len(message_list) > 0:
|
||||
try:
|
||||
# send message
|
||||
send_coin_telegram_message(message_list, header="[KRW-COIN]")
|
||||
except Exception as e:
|
||||
print(f"Error sending Telegram message: {str(e)}")
|
||||
|
||||
return
|
||||
|
||||
def run_schedule():
|
||||
|
||||
# 코인 모니터링 스케줄 (매시간 1분, 11분, 21분, 31분, 41분, 51분)
|
||||
# 코인 모니터링 스케줄 (매시간 4분, 14분, 24분, 34분, 44분, 54분)
|
||||
for minute in [4, 14, 24, 34, 44, 54]:
|
||||
schedule.every().hour.at(f":{minute:02d}").do(monitor_coins)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user