cinatic / stocks-extension

A extension to display stock quotes in GNOME Shell Panel
GNU General Public License v3.0
84 stars 31 forks source link

Add new finance data provider `eastmoney` for asian / china financial instruments #16

Closed wangshouren000 closed 3 years ago

wangshouren000 commented 3 years ago

hi,good job. now I want to see china stock markets in time. but yahoo data source is 15min delay. could you add one of the china source provider as: sina finance.sina.com.cn/stock
or eastmoney quote.eastmoney.com/center/hszs.html or 163 money.163.com an I have a second question: if the graphic is one day cycle ,but not all days.

to debug gjs is a very hard job for me. great thanks!!!

cinatic commented 3 years ago

yes indeed, i really want add more quote sources, this would be a great excersise. Can you answer one of those questions:

  1. Which source would you prefer, are there some differences?
  2. Do the provide APIs, documentation?

Not sure if i get you right if the graphic is one day cycle ,but not all days.

Currently the chart is fixed by 6 month with 1 day intervals, i plan to add some more options with one of the next releases

wangshouren000 commented 3 years ago

yes indeed, i really want add more quote sources, this would be a great excersise. Can you answer one of those questions:

  1. Which source would you prefer, are there some differences?
  2. Do the provide APIs, documentation?

Not sure if i get you right if the graphic is one day cycle ,but not all days.

Currently the chart is fixed by 6 month with 1 day intervals, i plan to add some more options with one of the next releases

for example,i choose eastmoney http://quote.eastmoney.com/zs000001.html ,so:

1、1 day with 1 min intervals in time,this is a default option url:http://push2his.eastmoney.com/api/qt/stock/trends2/get?&secid=1.000001&fields1=f1%2Cf2%2Cf3%2Cf4%2Cf5%2Cf6%2Cf7%2Cf8%2Cf9%2Cf10%2Cf11&fields2=f51%2Cf53%2Cf56%2Cf58&iscr=0&ndays=1

we can get a json with:

dataset : data.trends data structure : time,close,vol,open inparams: secid=1.000001 means type=1 ,which is Shanghai market type=0 ,which is shenzhen market symbol=000001 they connect with “.” as secid ndays=1 means one day data with intervals 1min

2、multiple type of intervals (this also contains 1min intervals)

url:http://push2his.eastmoney.com/api/qt/stock/kline/get?&secid=0.399001&fields1=f1%2Cf2%2Cf3%2Cf4%2Cf5&fields2=f51%2Cf52%2Cf53%2Cf54%2Cf55%2Cf56%2Cf57%2Cf61&klt=101&fqt=1&beg=20180930&end=20201208 also return a json with: dataset : data.klines data structure : time,open,close,high,low,vol,amount,turnoverate inparams: secid, the same as above klt: 1 1min 5 5min 15 15min 30 30min 60 60min 101 day 102 week 103 month 104 quarter 106 year fqt: 1,before Rehabilitation,this is default value 2,after Rehabilitation

beg,end:yyyymmdd 

my bad english “if the graphic is one day cycle ,but not all days”, it means 1 day with 1 min interval,if this option is default,i can see current trend in time.

cinatic commented 3 years ago

thanks this helps

  1. sad that it only provides the preClose so the change has to be calculated manually, not a big deal but how about requesting ndays=1 on a sunday will i still get the quotes from last trading day? I will do some observations too

  2. so those are the two available markets 0:shenzhen and 1:shanghai can i assume if the data is a stock, it is valid to show 元 as currency?

wangshouren000 commented 3 years ago

answer: 1、yes,the change need to be calculated manually.in china, saturday,sunday and holiday the market is close. so requesting ndays=1 may no data 2、yes

Huang-CL commented 1 year ago

Could you please provide a demo on how to use eastmoney provider? I tested many symbol names and none of them work. It would be helpful to use SP 500 index and CSI 300 Index as examples. Thanks!