init
This commit is contained in:
11
monitor.py
11
monitor.py
@@ -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,10 +454,11 @@ 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})"
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user