INNER CODE UNIT · Python
add_pair_to_gunbot
GuntharDeNiro/gunbot-quant · gunbot_quant/cli/main.py:25
def add_pair_to_gunbot(
exchange: Annotated[str, typer.Argument(help="The exchange name as it is configured in your Gunbot (e.g., 'binance').")],
strategy_name: Annotated[str, typer.Argument(help="The name of the GQ strategy to use (e.g., 'RSI_Reversion').")],
pairs: Annotated[List[str], typer.Argument(help="A list of pairs in standard format (e.g., BTCUSDT ETHUSDT).")],
quote_asset: Annotated[str, typer.Option(help="The quote asset for all pairs (e.g., USDT).")] = "USDT"
):
"""
Adds one or more pairs to a connected Gunbot instance with a specified strategy.
"""
print("--- Connecting to Gunbot ---")
api = gunbot_client.get_gunbot_api()
if not api:
print("❌ Error: Gunbot not connected. Please connect via the UI first or ensure gunbot_creds.json exists.")
raise typer.Exit(code=1)
status = gunbot_client.auth_status()
if not status.get("success"):
print(f"❌ Error: Gunbot connection failed: {status.get('error')}")