# Quote related

# Q1: Subscription failed

A: When the subscription interface returns an error, there are two common situations.

  • Insufficient subscription quota

    Please refer to Subscription Quota & Historical Candlestick Quota for the subscription quota rules.

  • Insufficient quota right

    The quota right that supports subscription are shown in the following table:


    Market Contracts Quota Right for Subscription
    HK Market Secrities LV2, SF
    Options LV1, LV2
    Futures LV1, LV2
    US Market Secrities LV1, LV2
    Options LV1
    Futures LV2
    A-Share Market Secrities LV1

    Please refer to Quote Right for the access method.

    Note: If your account has the above-mantioned quota rights, but the subscription still fails. The possible reason is that the quota right has been kicked out by other terminals.

# Q2: Unsubscribe failed

A: You can unsubscribe after you subscribe for at least one minute.

# Q3: The unsubscribe was successful but the quota was not released

A: The quota is released after all connections are unsubscribed to the market.

For example: Connection A and Connection B are both subscribing to HK.00700's listing data. After Connection A is unsubscribed, because Connection B is still calling HK.00700's listing data, the OpenD quota will not be released until all connections have been unsubscribed the listing data of HK.00700.

# Q4: Will the quota be released if the script connection is closed if the subscription is less than one minute?

A: No. After the connection is closed, the target type whose subscription duration is less than one minute will be automatically unsubscribed after reaching one minute, and the corresponding subscription quota will be released.

# Q5: What is the specific restriction logic for requesting frequency restriction?

A: At most n times within 30 seconds, it means that the interval between the first request and the n+1th request must be greater than 30 seconds.

# Q6: What is the reason why self-selected stocks cannot be added?

A: Please check whether the upper limit is exceeded first, or delete part of the self-selected stocks.

# Q7: Why is the US stock quotation on the OpenAPI side different from the national comprehensive quotation on the client side?

A: Since US stock trade are scattered on many exchanges, Futu provides two basic quotations for US stocks, one is Nasdaq Basic (quotes on the Nasdaq exchange), and the other is a comprehensive quotation for the United States (all 13 exchanges in the United States). However, OpenAPI's US stock quote currently only support Nasdaq Basic purchases through quotation card, and do not support comprehensive US quote.
Therefore, if you purchase both the US comprehensive quotation card on the APP side and the Nasdaq Basic quotation card that is only used for OpenAPI, there may indeed be a difference in the quotation between the APP side and the OpenAPI side.

# Q8: Where can I buy OpenAPI quotation cards?

# Q9: Why sometimes, the response of the get interface to obtain real-time data is slow?

A: Because the get interface for real-time data needs to be subscribed first, and it depends on the push to OpenD from the background. If the user uses the get interface to request immediately after subscribing, OpenD may not receive the background push yet. In order to prevent this from happening, the get interface has built-in waiting logic, and the push will be returned to the script immediately after receiving the push within 3 seconds, and empty data will be returned to the script if the background push is not received for more than 3 seconds. The get interfaces include: get_rt_ticker, get_rt_data, get_cur_kline, get_order_book, get_broker_queue, get_stock_quote. Therefore, when you find that the response of the get interface for obtaining real-time data is relatively slow, you can first check whether it is the cause of no trade data.

# Q10: What kind of data can be obtained after purchasing the OpenAPI Nasdaq Basic quotation card?

A: After the Nasdaq Basic quotation card purchase is activated, the categories that can be obtained include Nasdaq, NYSE, NYSE MKT stocks listed on the exchange (including US stocks and ETF, excluding US stock futures and US stock options). Supported data interfaces include: snapshots, historical candlestick, real-time ticker subscriptions, real-time one-stage subscriptions, real-time candlestick subscriptions, real-time quotation subscriptions, real-time Time Frame subscriptions, and price reminders.

# Q11: How many levels does each market category support?

A:

Quotes category BMP LV1 LV2 SF
HK stocks (including Stock, Warrants, bulls and bears, and inbound securities) 0 / 10 full stock + thousand details
HK stock options futures 0 1 10 /
US stocks (including ETF) / 1 Up to 40 order details /
US stock options / 1 / /
US futures / / Up to 40 order details /
A-shares / 5 / /

# Q12:Why does OpenD still have no quote right after I purchase and activate the quotation card?

A:

  1. The quote right of OpenAPI is not exactly the same as that of APP. Some quotation cards are only applicable to the APP side. Please confirm that the card you purchased is applicable to OpenD first. We have listed all the quotation cards applicable to OpenAPI in the section Authorities and Limitations. Please click here.

  2. After activating the quotation card, your quote right will be effective immediately. Please check after restarting OpenD.

# Q13:How to Get Real-time Quotes Through Subscription Interface?

The First Stop:Subscription

Pass the code of underlying security and data type to Subscription Interface to finish subscribing.

Subscription interface supports requesting real-time quote, real-time order book, real-time tick-by-tick, real-time Time Frame, real-time candlesticks and real-time broker queue. After a successful subscription, OpenD will continuously receive real-time data from Futo Server.

Attention: The subscription quota is allocated by your total capital, trading amount and trading volume. Please refer to Subscription Quota & Historical Candlestick Quota for details. If your subscription quota is not enough, please check if there is any useless subscriptions in the quota. Unsubscribe to release the subscription quota in time.

The Second Step:Obtain Data

We provide two methods to obtain subscribed data from OpenD:

Methos 1: Real-time data Callback
Set corresponding callback functions to process the pushed data asyncronously.

After the callback function is set, OpenD will immediately push the received real-time data to the callback function of the script for processing.

If the underlying security is very active, you may get a large amount of pushed data with high frequency. If you want to slower the push frequency of OpenD, we recommand you to config push frequency(qot_push_frequency) in OpenD Startup Parameter

The interfaces involved in mode 1 include: Real-time Quote Callback, Real-time Order Book Callback, Real-time Candlestick Callback, Real-time Time Frame Callback, Real-time Tick-by-Tick Callback, Real-time Broker Queue Callback.

Method 2: Get Real-time Data
Through the access to real-time data interface, you can use scripts to get the latest data received by OpenD. This approach is more flexible, and scripts do not need to deal with massive pushes. As long as OpenD continues to receive push from servers, the script can obtain the data on demand.

As the data is taken from the pushed data received by OpenD, there is no frequency limit for this type of interface.

The interfaces involved in mode 1 include: Get Real-time Quote of Securities, Get Real-time Order Book, Get Real-time Candlestick, Get Real-time Time Frame Data, Get Real-time Tick-by-Tick, Get Real-time Broker Queue.

# Q14:What time period corresponds to each market state?

A:

Market Security Type Market State Time Period (Local time)
HK Market Securities (including stocks, ETFs, warrants, CBBCs, Inline Warrants) * NONE: No trading CST 08:55 - 09:00
* ACTION: Pre-market trading CST 09:00 - 09:20
* WAITING_OPEN: Waiting for opening CST 09:20 - 09:30
* MORNING: Morning session CST 09:30 - 12:00
* REST: Lunch break CST 12:00 - 13:00
* AFTERNOON: Afternoon session CST 13:00 - 16:00
* HK_CAS: After-hours bidding for HK stocks (The market state corresponding to the addition of CAS mechanism to the Hong Kong stock market) CST 16:00 - 16:08
* CLOSED: Market closed CST 16:08 - 08:55(T+1)
Options, Futures (Day Market only) * NONE: Waiting for options opening CST 08:55 - 09:30
* MORNING: Morning session CST 09:30 - 12:00
* REST: Lunch break CST 12:00 - 13:00
* AFTERNOON: Afternoon session CST 13:00 - 16:00
* CLOSED: Market closed CST 16:00 - 08:55(T+1)
Futures (Day and Night Market) * FUTURE_DAY_WAIT_FOR_OPEN: Futures market wait for opening Different trading time for different species
* NIGHT_OPEN: Night market trading hours
* NIGHT_END: Night market closed
* FUTURE_DAY_WAIT_FOR_OPEN: Futures market wait for opening
* FUTURE_DAY_OPEN: Day market trading hours
* FUTURE_DAY_CLOSE: Day market closed
US Market Securities (including stocks, ETFs) * PRE_MARKET_BEGIN: Pre-market trading EST 04:00 - 09:30
* AFTERNOON: Regular trading hours EST 09:30 - 16:00
* AFTER_HOURS_BEGIN: After-hours trading EST 16:00 - 20:00
* AFTER_HOURS_END: Market closed of U.S. stock market EST 20:00 - 04:00(T+1)
Options * NONE: Waiting for options opening Different trading time for different species
* REST:Lunch break
* AFTERNOON: Regular trading hours
* TRADE_AT_LAST: Late trading hours
* NIGHT: Night market trading hours
* CLOSED: Market closed
Futures * NONE: Waiting for U.S. futures opening Different trading time for different species
* FUTURE_OPEN: Trading hours of U.S. futures
* FUTURE_BREAK: Break of U.S. futures
* FUTRUE_BREAK_OVER: Trading hours of U.S. futures after break
* FUTURE_CLOSE: Market closed of U.S. futures
A-share Market Securities (including stocks, ETFs) * NONE: No trading CST 08:55 - 09:15
* Action: Pre-market trading CST 09:15 - 09:25
* WAITING_OPEN: Waiting for opening CST 09:25 - 09:30
* MORNING: Morning session CST 09:30 - 11:30
* REST: Lunch break CST 11:30 - 13:00
* AFTERNOON: Afternoon session CST 13:00 - 15:00
* CLOSED: Market closed CST 15:00 - 08:55(T+1)
Singapore Market Futures * FUTURE_DAY_WAIT_FOR_OPEN: Futures market wait for opening Different trading time for different species
* NIGHT_OPEN: Night market trading hours
* NIGHT_END: Night market closed
* FUTURE_DAY_OPEN: Day market trading hours
* FUTURE_DAY_CLOSE: Day market closed
Japanese Market Futures * FUTURE_DAY_WAIT_FOR_OPEN: Futures market wait for opening JST 16:25(T-1)- 16:30(T-1)
* NIGHT_OPEN: Night market trading hours JST 16:30(T-1) - 05:30
* NIGHT_END: Night market closed JST 05:30 - 08:45
* FUTURE_DAY_OPEN: Day market trading hours JST 08:45 - 15:15
* FUTURE_DAY_CLOSE: Day market closed JST 15:15 - 16:25
* CST, EST, JST represent China time, US Eastern time, and Japan time respectively.

# Q15:Parameter format of stock code.

A:

  • For users with different programming languages, parameter format of stock code is different.

    • Python users
      Format of stock code: market.code.
      For example: Tencent. Parameter code should be passed in 'HK.00700'.

    • Non-Python users
      For stock structure, refer to Security.
      For example: Tencent. Parameter market should be passed in QotMarket_HK_Security, parameter code should be passed in '00700'.

  • Quick inquiries. View the code and market through APP: Quotes > Watchlists > All.
    For Quote Market, refer to here.
    code

# Q16:Stock Price Adjustment

A:

# Overview

Price adjustment refers to adjusting stock price and trading volume after corporate actions, so that the price chart can better represent actual price moves and trading volume.
Corporate actions such as stock split, reverse stock split, bonus issue, rights issue, allotment, secondary offering, and dividend payment can affect the stock price. Price adjustment eliminates the impact of corporate actions on stock price and trading volume, and maintains the continuity of the stock price moves.

Tips

  • The information on this page is mainly intended for the China A-share market.

# Glossary

  • Corporate action: Actions on equity and stock conducted by a listed company that affect the company's stock price and number of shares.
  • Default adjustment: Keep the current stock price unchanged, and use it as the benchmark to re-calculate all previous stock prices.
  • Cumulative adjustment: Keep the stock price before the earliest corporate action unchanged, and use it as the benchmark to re-calculate all future stock prices.
  • Price adjustment factor: The ratio used to re-calculate the adjusted and cumulative stock prices and number of shares after a corporate action. There are two types of price adjustment factors: the default adjustment factor for calculating the adjusted price and the cumulative adjustment factor for calculating the cumulative price.
  • Ex-div and pay date: The next trading day of the registration date. The stock exchange must calculate the adjusted stock price before market open on the ex-and-pay date. It is also the date on which dividends are distributed to shareholders and changes in the number of shares take place.

# Price Adjustment Methods

There are two price adjustment methods: two-step method and continuous multiplication. OpenAPI uses different adjustment methods for different markets.

  • Two-step method: The stock price is adjusted based on corporate actions; there are 2 factors in this method: factor A for cash dividends and factor B for all other corporate actions.
  • Continuous multiplication: The stock price is adjusted the continuously multiplying the adjustment factors. This method can be seen as a special case of two-step method with factor B as 0.

Tips:

  • OpenAPI uses continuous multiplication for calculating the adjusted price of US stocks, with the price adjustment factor B set to 0.
  • OpenAPI uses two-step method for stocks other than US stocks (China A-shares, Hong Kong stocks, Singapore stocks, etc.) and for calculating the cumulative price of US stocks.

# Calculation Formulae

# Single Adjustment

  • Default adjustment:
    Adjusted price = Actual price × Default adjustment factor A + Default adjustment factor B
  • Cumulative adjustment:
    Cumulative price = Actual price × Cumulative adjustment factor A + Cumulative adjustment factor B

# Multiple Price Adjustments

  • Default adjustment: In chronological order, select the adjustment factors later than the adjustment date, and first use earlier adjustment factors for calculation. Take a double adjustment as an example:

code

  • Cumulative adjustment: In reverse chronological order, select the adjustment factors earlier than or on the calculation date, and first use later adjustment factors for calculation. Take a double adjustment as an example:

code

# Examples

# Example of a single adjustment

Take the stock of Muyuan Foods as an example:

  • Screening weighting factors are as follows:
Ex-Div and Pay Date Stock Symbol Corporate Action Details Default Adjustment Factor A Default Adjustment Factor B
06/03/2021 SZ.002714 10-share dividends: 4 shares and ¥14.61 (tax included) 0.71429 -1.04357
  • Data on actual price:
Date Stock Symbol Actual Closing Price
06/02/2021 SZ.002714 93.11
06/03/2021 SZ.002714 66.25
  • Data on adjusted prices:
Date Stock Symbol Adjusted Closing Price
06/02/2021 SZ.002714 65.4639719
06/03/2021 SZ.002714 66.25
  • Method for calculating adjusted prices:
    Muyuan Foods conducted a stock split and paid cash dividends on 2021/06/03 (4 shares and ¥14.61 for every 10 shares owned), and here is how to calculate the adjusted closing price on 06/02/2021: Adjusted price (65.4639719 ) = Actual price (93.11) × Default adjustment factor A (0.71429) + Default adjustment factor B (-1.04357)

code

# Example of multiple cumulative adjustment

Following on the previous example, here is how to calculate the cumulative price of Muyuan Foods on 06/02/2021:

  • Adjustment factors are as follows:
Ex-Date Stock Symbol Corporate Action Details Cumulative Factor A Cumulative Factor B
07/04/2014 SZ.002714 10-share dividends: ¥2.34 (tax included) 1 0.234
06/10/2015 SZ.002714 10-share dividends: 10 shares and ¥0.61 tax included) 2 0.061
07/08/2016 SZ.002714 10-share dividends: 10 shares and ¥3.53 tax included) (tax included) 2 0.353
07/11/2017 SZ.002714 10-share dividends: ¥6.91 (tax included) 1 0.691
07/03/2018 SZ.002714 10-share dividends: 8 shares and ¥6.9 (tax included) 1.8 0.69
07/04/2019 SZ.002714 10-share dividends: ¥0.5 (tax included) 1 0.05
06/04/2020 SZ.002714 10-share dividends: 7 shares and ¥5.5 (tax included) 1.7 0.55
  • Data on actual prices:
Date Stock Symbol Actual Price
06/02/2021 SZ.002714 93.11
  • Data on cumulative prices:
Date Stock Symbol Cumulative Price
06/02/2021 SZ.002714 1150.5114
  • Method for calculating cumulative prices:
    To calculate the cumulative price of Muyuan Foods on June 2, 2021, all the corporate actions by June 2, 2021 need to be taken into account. The detailed calculations are as follows:

code