mlouielu / twstock

台灣股市股票價格擷取 (含即時股票資訊) - Taiwan Stock Opendata with realtime

Home Page:http://twstock.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't fetch historical data before 2010

hvgmbdmg opened this issue · comments

Here is a simple example :

stock = Stock('2330')
stock.fetch(2008, 4)
for index in range(len(stock.data)):
    print(stock.data[index])

print(len(stock.data))

The result shows that stock.data is empty.
By the way, if fetch date after 2010, it will be workable.
Does anyone meet the same problem?

This is because TWSE has the limit that you cannot query before 20100104:

http://www.twse.com.tw/exchangeReport/STOCK_DAY?date=20090101&stockNo=2330

{"stat":"查詢日期小於99年1月4日,請重新查詢!"}