OKX Signal Strategy Alert Specifications: How to Set Up Alerts to Notify Trading Opportunities and Risks
OKX has now launched signal strategies, where users can publish signals through TradingView and create signal strategies on OKX based on these signals. When TradingView sends a signal and triggers the set conditions, trading can automatically begin. This article will introduce the various alert message specifications supported by OKX, that is, how to set up alerts to notify trading opportunities and risks.
Alert Message — Overview
This section will introduce what parameters and fields are included in alert message settings. The meaning of each parameter and field value will be introduced in detail in later sections.

Alert Message — Operations

Trading Mode:
Assume that the OKX signal strategy runs in a unilateral (buy/sell) mode, which means holding positions in only one direction.
Placing Orders
-
Open Long — ENTER_LONG: Place an order to hold a long position, expecting the price to rise.
-
Open Short — ENTER_SHORT: Place an order to hold a short position, expecting the price to fall.
Closing Positions
-
Close Long — EXIT_LONG: Place an order to sell the held position portion, that is, to close the long position.
-
Close Short — EXIT_SHORT: Place an order to buy back the position portion, that is, to close the short position.
Alert Message — Instruments

Type 1: ticker — TradingView placeholder value
"Standard placeholders" * are text fragments surrounded by double braces and included in alert messages. **"{{ticker}}"** will return the TradingView code that generated the alert.
For example: "BTCUSDT.P", "ETHUSDT.P".
* Standard placeholders for accessing variables in Pine Script.Learn more here.
Type 2: OKX Instrument Format
Instrument ID, or "instId" in OKX API. For example: "BTC-USDT-SWAP", "ETH-USDT-SWAP"
Alert Message — Signal Code

Signal Code: Signal authentication. This security measure is used to ensure that incoming requests are legitimate and authorized. When users successfully create a new signal on OKX, this signal Token will be automatically generated and needs to be copied to the TradingView Alert Message.
Alert Message — Timestamp

timenow — TradingView placeholder value
"Standard placeholders" * are text fragments surrounded by double braces and included in alert messages. **"{{timenow}}"** will return the current and exact time when the alert was generated, in UTC and yyyy-MM-ddTHH:mm:ssZ format.
For example: "2023-06-01T17:38:10Z"
*Standard placeholders for accessing variables in Pine Script.Learn more here.
Alert Message — Maximum Lag

max Lag — Maximum acceptable delay
In signal strategies, "max Lag" refers to the maximum acceptable delay time in seconds before a trading signal is received. The default setting is 30 seconds. Setting the max Lag value helps ensure timely execution of signal strategies, avoiding acting on outdated or potentially inaccurate signals that may no longer reflect current market conditions.
Alert Message — Order

Order Type (order Type)
-
Market (market): Place orders at market price. For example, when opening a position (action=ENTER_XX) or closing a position (action=EXIT_XX), there is no need to provide order Price Offset.
-
Limit (limit): Set limit orders for opening a position (action=ENTER_XX) or closing a position (action=EXIT_XX).
Order Price Offset (order Price Offset)
As mentioned above, this parameter only needs to be filled in for limit order types. That is, when placing limit orders, it allows orders to have an offset based on the limit price, which can increase the probability of order execution while ensuring execution at a relatively ideal price. After setting, the offset price calculation method for different operations is as follows:
-
Open Long: [1-(Order Price Offset/100)]*Best Bid Price
-
Open Short: [1+(Order Price Offset/100)]*Best Ask Price
-
Close Long: [1+(Order Price Offset/100)]*Best Ask Price
-
Close Short: [1-(Order Price Offset/100)]*Best Bid Price
Alert Message — Investment Type and Amount

1) For Buy Signals Only
-
Margin: Investment margin denominated in quote currency
-
Contracts: Fixed number of order contracts
-
Available Margin Percentage: Based on the percentage of available margin (i.e., available margin for opening new orders)
-
Initial Investment Percentage: Based on the percentage of initial investment margin when creating the bot. Additional margin added afterwards will not be calculated
2) For Sell Signals Only
- Position Percentage: Based on the percentage of open positions
OKX Signal Strategy Alert Setup Examples
Example 1: Open Long Position -> Close Long Position (Full Close)

Example 2: No Long Position -> Short Position (One-step Reversal)

Example 3: Open Long Position -> Close Long Position (Partial Close) -> Close Long Position (Full Close)

Example 4: Using Multiple Orders to Open Positions
Multiple order opening is a feature in OKX signal strategies that allows multiple order entry points for a given instrument. Traders can optimize trading strategies through multi-point orders (i.e., average cost method), attempting to increase profit potential in volatile market environments.

Example 5: Using Trigger Signals Only (Without Order-related Fields)

As shown in the figure above, for signal providers such as TradingView, they may exclude certain optional parameters and retain only some necessary signal parameters. The reason is that users may have already configured these parameters when creating the strategy. For example, if they are already set in the OKX signal strategy, there is no need to set them again in TradingView.
For providers focused only on providing buy/sell trigger signals, this allows them to focus more on signal parameter research, while for users, deciding order dimension parameters themselves, such as investment amount and percentage, can make trading more free and effective.

Example 6: Using Trigger Signals Only (Without Order-related Fields)

If users do not specify order details in both the signal platform and strategy creation platform parameter configurations, default values will be used.
-
For **buy (open position)** signals, by default, it will use market orders to place orders at X% percentage (when single pair, X=100; when multiple pairs, X=50).
-
For **sell (close position)** signals, by default, it will close 100% of open positions after receiving the signal.

Example 7: Field Order Priority
Parameters of the signal strategy take precedence over parameters of the signal platform, that is, parameters of the OKX signal strategy take precedence over TradingView signal parameters. Two rules also need to be noted here:

Disclaimer
This article may contain product-related content that is not applicable to your region. This article is committed to providing general information only and is not responsible for any factual errors or omissions therein. This article represents only the author's personal views and does not represent the views of OKX. This article is not intended to provide any advice, including but not limited to: (i) investment advice or investment recommendations; (ii) offers or solicitations to purchase, sell or hold digital assets; or (iii) financial, accounting, legal or tax advice. Holding digital assets (including stablecoins) involves high risk, may fluctuate significantly, and may even become worthless. You should carefully consider whether trading or holding digital assets is suitable for you based on your financial situation. For questions regarding your specific situation, please consult your legal/tax/investment professional. The information appearing in this article (including market data and statistics, if any) is for general reference only. Although we have taken all reasonable precautions in preparing these data and charts, we assume no responsibility for any factual errors or omissions expressed herein. © 2025 OKX. This article may be reproduced or distributed in full, or excerpts of 100 words or less from this article may be used, provided that such use is non-commercial. Any reproduction or distribution of the entire article must also prominently state: "Copyright © 2025 OKX. Used with permission." Permitted excerpts must cite the article name and include attribution, for example "Article Name, [Author Name (if applicable)], © 2025 OKX". Some content may be generated or assisted by artificial intelligence (AI) tools. Derivative works or other uses of this article are not permitted.
Show More
Alert Message — Overview
Alert Message — Operations
Alert Message — Instruments
Alert Message — Signal Code
Alert Message — Timestamp
Alert Message — Maximum Lag
Alert Message — Order
Alert Message — Investment Type and Amount
OKX Signal Strategy Alert Setup Examples
Recommended Reading

Cryptocurrency Scams You Need to Know About
Although the cryptocurrency industry offers breakthrough opportunities for growth and innovation, it has also attracted considerable fraudulent activity. Cryptocurrency trading scams often disguise themselves as enticing opportunities, promising high returns with extremely low risk. These scams take various forms, from sophisticated Ponzi schemes to deceptive initial coin offerings (ICOs), luring traders into traps set by cunning scammers. On the other hand, withdrawal scams add another layer of complexity, where traders find themselves trapped in
March 11, 2026
Beginner

Martingale Strategy (DCA) — How to Average Costs Through Strategy
DCA, full name Dollar Cost Averaging, commonly known as Martingale strategy in Chinese, is more commonly used in the foreign exchange market in traditional finance. If you always worry about not being able to bottom out, or if the investment target continues to fall after buying at a low point, then understanding and using the Martingale strategy will be beneficial for more effective investment in the cryptocurrency market. What is the Martingale Strategy (DCA)? The Martingale
February 27, 2026
Intermediate

Cryptocurrency Technical Analysis Guide: 5 Common Analysis Tools Fully Introduced!
February 27, 2026
Beginner

Trading Bitcoin: Technical and Fundamental Analysis of BTC in 2024
In 2024, Bitcoin is driving the cryptocurrency market upward. Investors who want to trade Bitcoin need to understand trading tools and core token metrics before doing so. Whether you are just starting to explore cryptocurrency trading or have already accumulated some experience, you may want to trade and invest in Bitcoin. As a member of the cryptocurrency world, Bitcoin is known as "digital gold." It has not only stood the test of time but was also the first to challenge the traditional financial world
February 26, 2026
Beginner

How to Conduct Block Trading in the OKX Liquidity Market?
Block trading is one of the cutting-edge products and services offered by OKX, and users can use this feature in our liquidity market. Block trading enables users to enter or exit significant cryptocurrency positions without worrying about the risk of price slippage. The OKX liquidity market supports trading for multiple instruments, and users can execute block trades here and deploy more complex multi-leg trading strategies. This article will introduce how to use block trading in the OKX liquidity market
February 26, 2026
Intermediate

What Are "Pig Butchering" Scams and How to Avoid Them?
"Pig butchering" scams are a relatively new form of fraud in the cryptocurrency field, where scammers commit financial fraud against victims through fake romantic or friendship relationships. These scams are usually carefully planned over a long period, where scammers win the victims' trust, encourage them to invest funds in seemingly legitimate opportunities, and then suddenly disappear. As cryptocurrency gradually goes mainstream, "pig butchering" scams are also increasing. This article will explain what "pig butchering" scams are and
February 21, 2026
Beginner



