Setting Up Your OKX Broker Profile in MultiCharts

·

Integrating your OKX account with MultiCharts enables powerful automated trading and advanced charting capabilities. This guide provides a detailed walkthrough for configuring both Futures and Spot broker profiles, ensuring a smooth and reliable connection.

Before you begin, ensure you have generated your API Key and Secret Key from your OKX account. These credentials are essential for establishing a secure link between the platforms. Additionally, verify that the OKX data feed is correctly set up within MultiCharts to receive real-time market data.

Configuring the OKX Futures Broker Profile

To start trading futures, you must first configure the broker profile within MultiCharts. Access the OKX Futures Settings window through the Broker Profiles management section.

Main Tab Configuration

The Main tab houses the critical settings for connectivity and order management.

Connectivity Section

In this section, you input the credentials that authorize the connection.

Default Order Settings Section

This section defines how your orders are handled by default.

Global Section

These settings enhance the stability and feedback of your connection.

Understanding the Contracts Ratio Tab

A key concept for trading cryptocurrencies on OKX via MultiCharts is the Contracts Ratio. Since MultiCharts does not support trading fractional shares, this ratio acts as a multiplier.

The value in this tab represents how one contract in MultiCharts translates to contracts on the OKX exchange. For instance, if the Contracts Ratio for AVAX-USDT-SWAP is set to 0.1, an order for 1 contract in MultiCharts will result in an order for 0.1 contracts on OKX. Always verify this ratio against the minimum trade size requirements on OKX to avoid order rejections.

👉 Explore more strategies for managing contract sizes

How OKX Futures Trading Works in MultiCharts

It's important to understand how data and orders are processed between the two platforms.

Data Handling: OKX provides real-time data on account lists, balances, and open positions. However, equity calculations and open position Profit/Loss (P&L) are computed on the MultiCharts side.

Order Types: MultiCharts supports a full suite of order types for OKX Futures, including Market, Limit, Stop, and Stop-Limit orders.

OCO Groups: One-Cancels-the-Other (OCO) orders are emulated by MultiCharts. This means MultiCharts sends both orders to the broker and actively monitors the market price. When one order is filled, it immediately sends a cancellation command for the paired order. Be aware of the inherent risk: if the market moves extremely fast, the second order might be filled before the cancellation can be processed by the broker's server.

Configuring the OKX Spot Broker Profile

The setup process for Spot trading is similar to Futures but with a few distinct differences, primarily concerning how positions are handled.

Main Tab Configuration for Spot

The Connectivity and Global sections in the Spot profile are identical to the Futures setup. Enter your API Key, Secret Key, select the correct server and currency, and configure your timing and heartbeat preferences.

The Default Order Settings section for Spot is slightly simplified. You will still set the Time in Force and Orders request waiting limits, but options like Isolated Margin and Reduce Only are not applicable for spot trading.

Contracts Ratio and Position Emulation in Spot

The Contracts Ratio functions the same way in Spot trading. For example, a ratio of 0.001 for BTCUSDT means a 1-contract order in MultiCharts becomes a 0.001 BTC order on OKX.

The most significant difference with Spot trading is position emulation. Since OKX operates with a wallet system rather than a traditional position-based system, MultiCharts must emulate positions for its trading logic.

Note: When a position is opened, the executed volume on OKX will be slightly less than specified due to the trading commission taken from the base currency. To ensure positions are closed accurately, it is highly recommended to use the From Broker To Strategy MP Synchronizer power tool.

Troubleshooting Common Connection and Order Issues

Even with a correct setup, you may occasionally encounter issues.

Broker Profile Connection Failures

If clicking Connect does not establish a connection:

  1. For Futures, ensure you have pressed the Lookup button in the Leverage tab.
  2. Check the Logs tab in the Order and Position Tracker.

    • If you see a Timestamp for this request is outside of the recvWindow error, synchronize your computer's clock through the Date & Time settings.
    • An Invalid API-key, IP, or permissions for action error indicates an issue with your API credentials. Check for emails from OKX, contact their support, or generate a new API key.

Orders Being Rejected

Always check the Logs tab for the specific rejection reason.

Frequently Asked Questions

What are the main differences between Futures and Spot profiles in MultiCharts?
The Futures profile supports margin trading, isolated margin mode, and reduce-only orders. The Spot profile involves direct asset trading from your wallet and requires MultiCharts to emulate your trading positions based on its order history.

Why are my orders being rejected for being too small?
MultiCharts trades in whole integers, but OKX requires a minimum trade size. The Contracts Ratio bridges this gap. You must ensure that your order size in MultiCharts, when multiplied by the Contracts Ratio, meets or exceeds OKX's minimum requirement for that specific asset.

How does MultiCharts handle OCO orders?
MultiCharts uses an emulated OCO system. It submits both orders to the broker and manages the OCO logic internally. If one order is filled, it sends a cancel command for the other. There is a small risk of the second order filling before the cancel command is processed during volatile market conditions.

What should I do if my positions in MultiCharts don't match my OKX wallet?
For Spot trading, always use the Lookup or Recalculate buttons in the Open Positions tab to sync MultiCharts with its own order history. For the most accurate synchronization, utilize the From Broker To Strategy MP Synchronizer tool.

Why is my connection failing with a timestamp error?
This error occurs when your computer's clock is out of sync with OKX's servers. Use the "Sync now" feature in your computer's date and time settings to resolve this.

Where can I find the Contracts Ratio for a specific symbol?
The Contracts Ratio for each symbol is pre-loaded within the MultiCharts platform. You can find it by navigating to the Contracts Ratio tab within your OKX Futures or Spot broker profile settings.