Skip to main content

Multi-symbol bots

A multi-symbol bot trades any ticker on one exchange, one market type (Spot or Futures) and one quote currency (for example USDT), using one strategy key. Run the same TradingView strategy on as many charts as you like, all pointing at the same bot.

Availability

Multi-symbol bots need a Plus or Pro plan. The feature is being rolled out gradually: if the option is not shown in your app yet, it is not enabled for your account.

How it works​

  • The bot (parent) owns the strategy key, the budget (allocated amount) and max positions: the most coins that may be open at the same time.
  • Coins (children). The first entry for a ticker creates a child bot for that ticker. A child is a normal single-symbol bot with its own trades, and it shares the parent's budget. Children are shown inside their bot; in the app they are not managed one by one, while the OptAlgo API can weight, pause and remove a single coin (below).
  • Routing. Every signal is routed to the child of its ticker. From there on, it is handled exactly like a signal for a single-symbol bot.

Setting up​

  1. Create a multi-symbol bot in the app. Choose max positions and, optionally, the allocated amount and the market type. If you choose the market type now, it is locked. If you do not, the first ticker decides: Futures for a .P ticker, otherwise Spot.
  2. The bot starts on paper and waits for its first signal. Its first entry or VALIDATE_ALERT sets:
    • the exchange;
    • the market type;
    • the quote currency, from the ticker's market;
    • the allocated amount: 100 in the quote currency, if you did not set one;
    • the name, <EXCHANGE>-<QUOTE> MULTI-SYMBOL AUTO CREATED, if you did not rename it.
  3. Put the same alert message on every chart you want to trade, with {{ticker}} as the ticker. TradingView fills in each chart's own symbol. See the TradingView template.
  4. When you are happy with the results on paper, switch the bot to live. This requires an active exchange connection and no open coins.

Rules for every signal​

RuleRejection when broken
exchange must be the bot's exchangeSignal exchange <X> does not match this multi-symbol bot's exchange.
The ticker's market type must be the bot's (.P = Futures)This multi-symbol bot trades FUTURES: <TICKER> is not a FUTURES ticker.
A new ticker must be quoted in the bot's quote currencyThis multi-symbol bot trades USDT pairs: <TICKER> is quoted in ...
The ticker must exist on the exchangeTicker <TICKER> is not supported or not found on this bot's exchange (...)
TASK signals are not supportedTASK signals are not supported on multi-symbol bots.

An exit (CLOSE, CLOSE_PARTIAL, MOVE_STOP_LOSS and so on) for a ticker the bot has never traded is skipped, because there is nothing to act on.

Slots and sizing​

The budget is split into slots. Think of the bot as a small fund and of each coin as one of its legs: one budget on the bot, one slot per leg.

slot = allocated_amount / max_positions
  • Each entry is sized on one slot (times the coin's weight, below). The alert's tradable_ratio scales the entry inside its slot, and values above 1 are clamped to 1, so one coin can never use more than its slot.
  • leverage works as usual: notional = slot * tradable_ratio * leverage.
  • A slot is taken by a coin that has an open trade, or by a reservation for an entry that is still being executed. A reservation is created atomically before the entry is queued, so two coins racing for the last slot cannot both get it. It is released when the entry does not go through, or expires after 20 minutes.
  • When all slots are taken, a new coin's entry is rejected and you are notified: Max positions (N) reached on <bot>: <TICKER> entry ignored. Open: <coins>. Coins that are already open keep trading normally.
  • Closed trades' PnL compounds into the bot's budget, so the slot size grows or shrinks with the bot's results.

Weights: unequal legs​

By default every coin has weight 1 and gets exactly one slot. Through the OptAlgo API you can give a coin a different share of the budget:

entry size = allocated_amount / max_positions * weight
  • A weight of 2 gives the coin two slots, 0.5 half a slot. The entry is never larger than the whole budget.
  • Weights are positive and at most max_positions each, and the weights of all coins (unset coins count 1) may add up to at most max_positions. The API refuses more with weight_budget_exceeded, and refuses to lower max_positions below the current sum. Lower one coin before raising another.
  • A changed weight applies to the coin's next entry; an open position is not resized.
  • A coin exists (and can be weighted) once its first entry has spawned it. A coin that was removed and trades again starts with weight 1.
  • You are notified on Telegram when a weight changes, naming the API key that changed it.

Calls: GET /v1/bots/{bot_id}/children lists the coins with their weight, slot_amount (what the next entry is sized on), paused state, open position and PnL, plus weight_sum and free_slots; PATCH /v1/bots/{bot_id}/children/{ticker} with {"weight": 1.5} sets a weight. The bot itself reports free_slots, slot_amount (one weight-1 slot) and budget_used (the slot amounts of the coins that are open).

Pausing one coin​

Through the API you can pause a single coin without stopping the bot: PATCH /v1/bots/{bot_id}/children/{ticker} with {"paused": true}.

  • A paused coin takes no new entries (its entry alerts are rejected with Strategy deactivated, notified once). Its open position stays open, and its exits, partial closes and stop moves still go through.
  • {"paused": false} resumes it, as long as the bot itself is active.
  • Stopping the bot pauses every coin and starting it resumes every coin. A per-coin pause does not survive a stop and start of the bot.
  • DELETE /v1/bots/{bot_id}/children/{ticker} removes a coin that has no open position (close it first). Its trades stay in your history; a later entry alert for that ticker spawns it again.

Pauses and removals are announced to you on Telegram, naming the key.

Plan caps​

PlanOpen coins per multi-symbol bot
FreeNot available
PlusUp to 10
ProUp to 20

The plan is checked again on every new entry, not only when you create the bot:

  • If your subscription has ended (you are back on Free), new entries are rejected with Multi-symbol bots need a Plus or Pro plan: <TICKER> entry ignored. Open positions can still be closed.
  • If your plan allows fewer coins than the bot's max positions, the bot is limited to the plan's number of open coins, and you get a warning. The slot size still uses the bot's max positions.

Closing coins​

  • One coin: send a CLOSE (or FLAT) with that coin's ticker. Only that coin's trade is closed.
  • Part of one coin: send a CLOSE with that coin's ticker and a close_ratio below 1. See Partial close.
  • All coins: stopping the bot closes every open coin.

Stopping, editing and deleting​

  • Stop: every open coin is closed and the bot takes no new entries. When the bot is stopped, entries for a new ticker are rejected with Strategy deactivated. Coins follow the bot's state (every coin is paused; a start resumes every coin).
  • Edit: you can rename the bot, change its allocated amount, and change max positions (never below the number of coins that are open right now, never below the sum of the coins' weights, and never above your plan's cap). Switching between paper and live requires all coins to be closed.
  • Delete: refused while any coin is open. Deleting the bot deletes all its coins.
  • Single coins cannot be edited, started, stopped or deleted on their own in the app; manage the bot instead. Through the API a coin can be weighted, paused, resumed or removed (see above), never started or edited as a bot of its own.

Converting an existing bot​

You can turn an existing single-symbol webhook bot into a multi-symbol bot, for example when you want to run the same strategy on more coins.

  • The existing bot becomes the first coin of a new multi-symbol bot. It keeps its trades, its history and its strategy key.
  • The new multi-symbol bot takes the old bot's name, exchange, market type, paper/live state and allocated amount. It gets a key of its own.
  • Your existing TradingView alerts keep working. A signal sent with the old key is routed through the new bot, and with {{ticker}} in the alert, the old key can trade other coins too.
  • The conversion is refused for a bot that is still waiting for its first signal, and when max positions is below the number of open positions.

Messages you may see​

MessageMeaning
Multi-symbol bot is waiting for its first signal: ...An exit arrived before the bot's first entry. Nothing to do.
Position slots unavailable: entry ignored.The slot service was briefly unavailable. The entry was refused to avoid over-allocating. Exits are not affected.
Multi-symbol entries are paused (MULTI_SYMBOL_MODE=entries_off).OptAlgo has temporarily paused new coins platform-wide. Open coins and exits are not affected.