Webhooks
Webhooks let trading bots automatically react to incoming signals to start, modify, average or close deals. They can be used to integrate with any third-party software, including setting up strategies on platforms like TradingView.
To configure webhooks, open the editor of any Crazy bot — on Bybit or Binance liquidity — in Cryptorg.
Opening a deal
Section titled “Opening a deal”When a deal-opening command arrives via webhook, the message carries all necessary parameters as JSON. This can include the initial deal volume, averaging levels, close parameters, stop-loss, and other settings. The bot uses this info to immediately start a deal on Cryptorg.
To send a deal-open command from another program (e.g., TradingView), make a REST POST request to the corresponding webhook URL. The JSON body can include all the future deal parameters that are available in the bot editor. That includes all four sections: open, averaging, close and stop-loss. Parameters can change dynamically as you edit the bot.
Parameters
Section titled “Parameters”botId(optional) — specifies which bot the new deal configuration is for. If omitted, the system automatically opens deals matching the direction (strategy) and trading pairs (pairs) on behalf of the Ghost bot 👻.strategy— direction.pairs— trading pairs the deal will be opened on. You can omit some pairs used by the bot. If no trading pairs are specified at all, deals are opened on all the bot’s pairs.- section
OPEN— deal opening parameters.orderVolume— required, first order volume in USDT.- other parameters are optional.
- section
DCA(averaging) — averaging parameters. Can be disabled viaenabled = false. - section
CLOSE(closing) — deal closing parameters. - section
STOP(stop-loss) — stop-loss setup parameters.
Modifying a deal
Section titled “Modifying a deal”During a trade you may need to change parameters of an already open deal. The webhook lets you do this by changing three key sections:
- Order grid — cancel the current grid and create a new one with the given parameters.
- Take Profit section — change current TP parameters to new ones.
- Stop-Loss section — update stop-loss parameters.
The deal-modify webhook accepts the same parameters as the deal-open webhook, except the «Open» section — the deal is assumed to be already open.
Averaging a deal
Section titled “Averaging a deal”Averaging lets you add volume to an existing position to move the entry point closer to the current market price.
botId(optional) — bot identifier. If omitted, the system automatically averages active deals matching the direction (strategy) and trading pairs (pairs).strategy— direction.pairs— list of trading pairs on which to average positions in active deals.amount— averaging volume in USDT.
Closing a deal
Section titled “Closing a deal”This webhook lets you close an active deal. Useful for booking profit or limiting losses in real time.
botId(optional) — bot identifier.strategy— direction.pairs— list of trading pairs.closePosition— boolean: close the position (true) or cancel the deal leaving the position open (false).