# OKX

<figure><img src="/files/kxS4s2c75P2pmkIYAzfA" alt=""><figcaption></figcaption></figure>

1. You can connect as many bots as you want on OKX, however you can only connect 1 Runbot Strategy per OKX Signal Bot. If you want to run 3 different strategies, you'll need to create 3 different OKX Signal Bots & Webhooks.

***

### To receive your Strategy Alerts directly on OKX and automate your trading, go to <https://app.runbot.io/Bot/> or directly click on "Alerts Bots".

<figure><img src="/files/59wvjGemRDLMG8AjMXtE" alt="" width="157"><figcaption></figcaption></figure>

Find Credit webhooks section and click on "+" to Create a Credit webhook.

<figure><img src="/files/JYqT6QQ9I4jERSqboL8U" alt="" width="354"><figcaption></figcaption></figure>

***

On the Bot webhook configuration box, select 'Linked strategy' and pick the strategy you want to receive alerts from.

<figure><img src="/files/O4ALDX4A70yIU1MdJr1N" alt=""><figcaption></figcaption></figure>

***

Enter the exact amount of capital you wish to allocate to your trading strategy. The size of your orders will be based on this reference, which can be a lower or a higher amount, depending on the leverage of your strategy.&#x20;

<figure><img src="/files/uQTePYAUTzKlhH9wH3AI" alt=""><figcaption></figcaption></figure>

***

Select OKX to send alerts:&#x20;

<figure><img src="/files/eiSyocN6kCiU7wblYD6C" alt=""><figcaption></figcaption></figure>

***

Go to <https://www.okx.com/trade-swap-strategy/btc-usdt-swap> or click "Trading bots" on the top left of your OKX trading app.

<figure><img src="/files/8F3A3tDrNjV85bLBpELz" alt=""><figcaption></figcaption></figure>

***

Select "Signal Bots" on the bots menu.

If you can't find it, and the OKX app suggests switching to Pro Mode, go ahead and do so; the Signal Bot will then appear on the right side of your screen.

<figure><img src="/files/CPkIC6nwSWS1PhX1rqEm" alt=""><figcaption></figcaption></figure>

***

Click "Add a custom signal".

<figure><img src="/files/5QUrXmc6sxPT0W4iMAOn" alt=""><figcaption></figcaption></figure>

***

Choose a name for your Signal Bot, then click "Create signal".&#x20;

<figure><img src="/files/IJh6h79ZgBIplsFK87TD" alt=""><figcaption></figcaption></figure>

***

Select "Custom".

<figure><img src="/files/Qm9R64qiDSQoVR8y3wEV" alt=""><figcaption></figcaption></figure>

***

Then, copy the "Long (Entry)" message. \
\
\&#xNAN;*Only this message is necessary, the others can be ignored.*

<figure><img src="/files/9hz5gXGEeSKGda3jSeqx" alt=""><figcaption></figcaption></figure>

Go back to <https://app.runbot.io/Bot/> and paste the Long (Entry) message on the Signal token input box.

<figure><img src="/files/qCs3EntnDCIOy62VL9an" alt=""><figcaption></figcaption></figure>

Save changes on Runbot and click "Complete" on OKX.&#x20;

***

On your OKX Bots menu, click "Create Bot" from the bot you just created.

<figure><img src="/files/f0WzrdeMr3TnQTmLsdX4" alt=""><figcaption></figcaption></figure>

***

Select the trading pair of your Runbot Strategy.&#x20;

<figure><img src="/files/XN0mS4rJx36O9GrWLjXs" alt=""><figcaption></figcaption></figure>

***

Enter the amount of USD capital you want to allocate to your strategy in the "Invested margin" input box.&#x20;

**By default, you can leave the Leverage at 10x.** However if your strategy has a very high leverage, enter the maximum leverage of your strategy. This information can be found in your backtest infos. On the Backtest Stats box, click "Backtest informations", and read "Max position leverage".&#x20;

"Invested Margin x Leverage" only means the result of the MAXIMUM cap size allowed by your OKX bot. If you want to use "cross-mode", you can lower the invested margin and increase the leverage.&#x20;

<figure><img src="/files/ZlHxmURh5VH7Mvr6I51s" alt=""><figcaption><p>A maximum position of 50 000$ (10x5000$) can be open with this Signal bot. Be sure your strategy is executing smaller amounts if you encounter any trading error. </p></figcaption></figure>

***

Click "Create"!

<figure><img src="/files/ES30YILMf0iVedkJvAEi" alt=""><figcaption></figcaption></figure>

On Runbot, click ![](/files/e5issY8AL1GwdCQ0lScm) and ![](/files/bj1VVdpWC2ppgG7fXZuV) to start your automated trading with OKX and Runbot!

***

Happy Trading!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.runbot.io/webhooks-trading-bots/okx.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
