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

live data #12

Closed
edwardsun opened this issue Feb 9, 2020 · 25 comments
Closed

live data #12

edwardsun opened this issue Feb 9, 2020 · 25 comments

Comments

@edwardsun
Copy link

Hi,

I noticed there are two functions that can possibly provide real-time data.

  1. stock_zh_a_spot
  2. stock_zh_a_tick

I've questions/suggestions regarding both, respectively.

  1. Is it possible to provide a symbol argument to stock_zh_a_spot? eg. stock_zh_a_spot(symbol = '000001').
  2. Does stock_zh_a_tick provide live data during regular trade hours?
  3. I'm interested in symbol = 'sh204007' (GC007, repo rate). Can stock_zh_a_spot fetch this data?

Thanks.

@edwardsun
Copy link
Author

btw, stock_zh_a_tick does not seem to be able to fetch 'sh131802'.
Instead 'sh204007' is available. Thoughts? Thanks.

http://stockhtm.finance.qq.com/sstock/ggcx/131802.shtml

@albertandking
Copy link
Collaborator

Hello,
I have checked the function 'stock_zh_a_spot', sina website should run forloop to get all page stocks, then you can run select, so whatever, you have to wait for a forloop time.

@albertandking
Copy link
Collaborator

sh204007 is bond, 'stock_zh_a_spot' is just for stock, akshare will design 'bond_zh_a_spot' in future

@edwardsun
Copy link
Author

edwardsun commented Feb 9, 2020

sh204007 is bond, 'stock_zh_a_spot' is just for stock, akshare will design 'bond_zh_a_spot' in future

Hi, fortunately sh204007 actually works for historical data. I'm wondering if it also works for live data.

@edwardsun
Copy link
Author

Hello,
I have checked the function 'stock_zh_a_spot', sina website should run forloop to get all page stocks, then you can run select, so whatever, you have to wait for a forloop time.

Thanks for the info. It may be a good idea to put this message somewhere.

@albertandking
Copy link
Collaborator

‘stock_zh_a_tick ’ can only provide data after trading day at16:00

@albertandking
Copy link
Collaborator

In order to achieve the data, you can use
stock_zh_a_spot_df[stock_zh_a_spot_df["symbol"].str.contains("000001")]
to replace
stock_zh_a_spot(symbol = '000001')

@albertandking
Copy link
Collaborator

sh204007 is bond, 'stock_zh_a_spot' is just for stock, akshare will design 'bond_zh_a_spot' in future

Hi, fortunately sh204007 actually works for historical data. I'm wondering if it also works for live data.

I will consider a new interface to handle this type historical data

@albertandking
Copy link
Collaborator

Hello,
I have checked the function 'stock_zh_a_spot', sina website should run forloop to get all page stocks, then you can run select, so whatever, you have to wait for a forloop time.

Thanks for the info. It may be a good idea to put this message somewhere.

I will put the detail in docs and code docstrings

@albertandking
Copy link
Collaborator

btw, stock_zh_a_tick does not seem to be able to fetch 'sh131802'.
Instead 'sh204007' is available. Thoughts? Thanks.

http://stockhtm.finance.qq.com/sstock/ggcx/131802.shtml

yeah, thanks for your good idea, i will add func named bond_repo_zh_tick to handle it

@edwardsun
Copy link
Author

btw, stock_zh_a_tick does not seem to be able to fetch 'sh131802'.
Instead 'sh204007' is available. Thoughts? Thanks.
http://stockhtm.finance.qq.com/sstock/ggcx/131802.shtml

yeah, thanks for your good idea, i will add func named bond_repo_zh_tick to handle it

Great! Look forward to bond live data and historical tick data.

@albertandking
Copy link
Collaborator

btw, stock_zh_a_tick does not seem to be able to fetch 'sh131802'.
Instead 'sh204007' is available. Thoughts? Thanks.
http://stockhtm.finance.qq.com/sstock/ggcx/131802.shtml

yeah, thanks for your good idea, i will add func named bond_repo_zh_tick to handle it

Great! Look forward to bond live data and historical tick data.

ok

@edwardsun
Copy link
Author

btw, stock_zh_a_tick does not seem to be able to fetch 'sh131802'.
Instead 'sh204007' is available. Thoughts? Thanks.
http://stockhtm.finance.qq.com/sstock/ggcx/131802.shtml

yeah, thanks for your good idea, i will add func named bond_repo_zh_tick to handle it

Great! Look forward to bond live data and historical tick data.

ok

In fact, since bonds (and futures contracts) can expire, it might be a better idea to only post daily repo rates, reverse-repo rates, deposit rates, etc.

@albertandking
Copy link
Collaborator

btw, stock_zh_a_tick does not seem to be able to fetch 'sh131802'.
Instead 'sh204007' is available. Thoughts? Thanks.
http://stockhtm.finance.qq.com/sstock/ggcx/131802.shtml

yeah, thanks for your good idea, i will add func named bond_repo_zh_tick to handle it

Great! Look forward to bond live data and historical tick data.

ok

In fact, since bonds (and futures contracts) can expire, it might be a better idea to only post daily repo rates, reverse-repo rates, deposit rates, etc.

what's the meaning of 'only post daily repo rates, reverse-repo rates, deposit rates'

@edwardsun
Copy link
Author

what's the meaning of 'only post daily repo rates, reverse-repo rates, deposit rates'

Sorry please discard my comment. :)

@albertandking
Copy link
Collaborator

what's the meaning of 'only post daily repo rates, reverse-repo rates, deposit rates'

Sorry please discard my comment. :)

ok

@edwardsun
Copy link
Author

Just want to follow up on interest rates live data fetch. Any recent plan? Thanks.

@albertandking
Copy link
Collaborator

interest rates live data

do you have any good data-source website for interest rates live data?

@albertandking albertandking reopened this Feb 13, 2020
@edwardsun
Copy link
Author

edwardsun commented Feb 13, 2020

do you have any good data-source website for interest rates live data?

I think the sina website that you are currently using is a good data source.
http://finance.sina.com.cn/bond/

For example,
image

I believe SHIBOR data are already present in akshare so needless to replicate.

There are additional rates data, like sz131802 (R-014), but it's unclear how to structure the codes.

@albertandking
Copy link
Collaborator

do you have any good data-source website for interest rates live data?

I think the sina website that you are currently using is a good data source.
http://finance.sina.com.cn/bond/

For example,
image

I believe SHIBOR data are already present in akshare so needless to replicate.

There are additional rates data, like sz131802 (R-014), but it's unclear how to structure the codes.

In akshare version 0.3.95:
add 沪深债券 and 沪深可转债
https://akshare.readthedocs.io/zh_CN/latest/data/bond/bond.html#id7

@edwardsun
Copy link
Author

In akshare version 0.3.95:
add 沪深债券 and 沪深可转债
https://akshare.readthedocs.io/zh_CN/latest/data/bond/bond.html#id7

Great! Thanks~

@edwardsun
Copy link
Author

edwardsun commented Feb 14, 2020

I'm afraid there is a need to reopen the ticket.
bond spot data does not contain any interest rate data...

It would be ideal to access the following website to simply provide symbol and extract live data.

image

Otherwise live repo rates are tabulated at http://finance.sina.com.cn/bond/

@edwardsun edwardsun reopened this Feb 14, 2020
@albertandking
Copy link
Collaborator

I'm afraid there is a need to reopen the ticket.
bond spot data does not contain any interest rate data...

It would be ideal to access the following website to simply provide symbol and extract live data.

image

Otherwise live repo rates are tabulated at http://finance.sina.com.cn/bond/

real tick data should maintains the requests to interface, just like the interface used in futures functions? or what kind of data?

@edwardsun
Copy link
Author

real tick data should maintains the requests to interface, just like the interface used in futures functions? or what kind of data?

The first provided link, http://money.finance.sina.com.cn/bond/quotes/sz131802.html, or the generic http://money.finance.sina.com.cn/bond/quotes/**{symbolname}**.html, can give users the flexibility to fetch live data in which they are interested. It might be difficult to implement, I guess.

In terms of another live data source for interest rates (repo rates), I've found this one.
https://www.chinabond.com.cn/jsp/include/EJB/realtimeV2_jm_hg.jsp

Again, thanks a lot for providing such a great tool.

@edwardsun
Copy link
Author

closing the ticket for now. maybe useful when there are more use cases from other users.

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

2 participants