This commit is contained in:
dsyoon
2025-09-01 21:42:19 +09:00
parent a5d3fd1c42
commit f422f5f87c

View File

@@ -343,7 +343,7 @@ class Monitor(HTS):
self._save_buy_cooldown()
print(f"{KR_COINS[symbol]} ({symbol}) [{data['signal'].iloc[-1]}], 현재가: {data['Close'].iloc[-1]:.4f}, 20분간 매수 금지 시작")
self.sendMsg("{}".format(self.format_message('COIN', symbol, KR_COINS[symbol], data['Close'].iloc[-1], data['signal'].iloc[-1], buy_amount)))
self.sendMsg("{}".format(self.format_message(symbol, KR_COINS[symbol], data['Close'].iloc[-1], data['signal'].iloc[-1], buy_amount)))
except Exception as e:
print(f"Error buying {symbol}: {str(e)}")
return False
@@ -454,11 +454,12 @@ class Monitor(HTS):
return data
# ------------- Formatting -------------
def format_message(self, market_type: str, symbol: str, symbol_name: str, close: float, signal: str, buy_amount: float) -> str:
message = f"매수 [{market_type}] {symbol_name} ({symbol}): "
message += f"{'$' if market_type == 'US' else ''}{close:.4f}"
message += f"({'$' if market_type == 'US' else ''}{buy_amount:.4f})"
message += f"[{signal}]"
def format_message(self, symbol: str, symbol_name: str, close: float, signal: str, buy_amount: float) -> str:
message = f"매수 {symbol_name} ({symbol}): "
message += f"''{close:.4f}"
message += f" (''{buy_amount:.4f})"
if signal != '':
message += f"[{signal}]"
return message
def format_ma_message(self, info: dict, market_type: str) -> str: