OKX and Alertatron goes into the next phase of partnership

Published on Apr 11, 2023Updated on Apr 4, 20245 min read

Alertatron is a well-known platform for algorithmic trading in digital asset markets. Starting December 13th, Alertatron's algorithmic traders can now conduct their automated trading on OKX, a platform that offers over 700 spot and derivatives markets for individual and managed trading groups.

This partnership is significant because it allows more traders to access the strong liquidity of the OKX exchange.

To further incentivize traders from Alertatron to OKX, OKX is offering additional benefits such as:

  1. Extra free month of subscription across both starter and pro plans
  2. A 5 OKB airdrop reward on cumulative trading volume of $5,000,000 before December 2023
  3. 1 ETH reward for hitting $10,000,000 in perpetual trading volume within a 30-day timeframe.

How to use Altertatron on OKX

Setting up Altertatron on OKX is simple. [Do view the instructions below]

How to connect Alertatron to OKX:

Create a set of API keys for Alertatron. This allows you to remove access at a later date without affecting any other services you use that also require API keys.

  1. Log into your OKX account, or your OKX Demo Trading account.
  2. Go to the Account menu and choose 'API'.
  3. Choose 'Create V5 API key for demo trading'. You'll be taken to a form to create your new API keys.
  4. Choose 'Binding third-party apps' as the Purpose, and select 'Alertatron' from the App Name list. This gives you maximum security, as the keys you created can only be used to trade from inside Alertatron.
  5. Give your keys a friendly name so you'll remember what you are using these keys for.
  6. The passphrase is a special password just for these API keys. Don't use your account password, but create a new password to protect these keys. You will need to enter this passphrase at Alertatron later. OKX is not responsible or liable for the safety or security of your password and API keys. Do ensure your password is stored in a safe and secure place.
  7. Finally, for Permissions, make sure you enable 'Trade', so the keys can create and cancel orders in your account.
    1280X1280create v5 api key for demo trading

Adding the keys to Alertatron

  1. From the Automated Trading menu, choose Configure Api Keys. (see image below).
  2. Choose OKX from the exchange list.
  3. Give the keys a name. This name is how you will refer to this set of API keys when you send orders to Alertatron. It should be letters only. If you are unsure, just call them 'okx'
  4. Enter the key into the Key field.
  5. Enter the secret into the Secret field.
  6. Enter the passphrase your set into the passphrase field.
  7. If the keys were for Demo Trading, then enable 'Use Testnet' option too.
  8. Click 'Add API Keys'
    Once you have saved your API keys, you're ready to start automating your trading with Alertatron.
    Configure api keys

Sending a test

Now your server is ready. It is a good idea to send a test command to it, to make sure everything is working as it should.

Set up an alert that includes the following text in it (it can have other text in the message though). Note that you'll need to change YourAPIKeyName to the name you used in step 3 of 'Adding the keys to Alertatron'.

  1. YourAPIKeyName(BTC-USDC) { limit(side=buy, amount=0.001, offset=3%); }
  2. #bot

You can quickly send a manual alert like this from Alertatron's Manual Alerts.

When this alert is triggered, your bot will attempt place a limit order on the BTC-USDC market to buy 0.001 BTC. You'll need some USDC balance for the order to be successful.
*Hint: If you have balance in other currencies, change the trading symbol from BTC-USDC in your test command to a market you want to trade in.

Please note the different contract sizes for different pairs, for example on BTC-USDT-SWAP the face value is 0.01 BTC, therefore placing an order for amount=1, will place an order for 0.01 BTC not 1 BTC.

Check out the getting started guide.
Do note that usage of Altertatron is subject to their terms of service.

Margin Mode

By default, Alertatron will use isolated margin mode for futures and swaps markets. You can adjust this using the exchange settings commands, which should be the first command in your script:

  1. Switch to cross margin mode, leverage 2x...

  2. exchangeSettings(marginMode=cross, leverage=2);

  3. OR, use isolated margin mode, with 3x leverage...

  4. exchangeSettings(marginMode=isolated, leverage=3);

  5. Always set both marginMode and leverage values together.

When placing new orders, or querying the current position, the margin mode will be taken into account (OKX is able to have open position in both cross and isolated margin mode at the same time).