Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR — Cannot subscribe to K-Line: No right to subscribe #45

Open
munum opened this issue Mar 3, 2023 · 5 comments
Open

ERROR — Cannot subscribe to K-Line: No right to subscribe #45

munum opened this issue Mar 3, 2023 · 5 comments

Comments

@munum
Copy link

munum commented Mar 3, 2023

Hi there. I'm trying to run the main_backend.py but I keep getting an error:

ERROR — Cannot subscribe to K-Line: No right to subscribe 00001

I have a subscription quota of 300 according to OpenD and subscription status query also shows 300:

INFO — Query Subscription Quota: {'total_used': 0, 'remain': 300, 'own_used': 0, 'sub_list': {}}

Does anyone know why this might be the case?

Any advice appreciated. Thanks.

  • Futu version 7.1.3308
@github-actions
Copy link

github-actions bot commented Mar 3, 2023

Hello @munum , thank you for submitting an issue! 👍 We highly appreciate it if you work on it as well.

@billpwchan
Copy link
Owner

Hmm from the error message, I think there may be an issue with the stock code you've provided.

If you want to subscribe HK.00001, need to input "HK.00001" instead of "00001" only, cuz this error message may be thrown either if you are illegible to subscribe (e.g., used up all the subscription quota) or providing an illegal stock code.

Let me know if you have any issue after changing the stock code. Thanks for using FutuAlgo!

@munum
Copy link
Author

munum commented Mar 24, 2023

I've been working on this issue for a while now. I can confirm that "HK.00001" is the input. Is it essential to have LV2 for it to behave correctly? Is BMP adequate?

@ireneyu9898
Copy link

ireneyu9898 commented Mar 26, 2023 via email

@munum
Copy link
Author

munum commented Mar 27, 2023

But doesn't place_buy_order() need more than BMP level even when paper trading? place_buy_order calls get_ask_and_bid, which calls quote_ctx.get_order_book. quote_ctx.get_order_book needs the stock to be subscribed first:

> self.trading_util.get_ask_and_bid("HK.00700")
2023-03-28 11:43:46,253 — trading_util — INFO — Get order book failed: No right to get this quote

No, BMP level subscription is sufficient to do paper trading, historical data download (with limited quota) and other functions like stock filtering. This error code was thrown by Futu library, and I suspect it is because of incorrect stock code was provided so they cannot download/subscribe any data of this ticker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants