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

Cannot get "YAHOO/OL_TEL" from Quandl for example. #12

Open
StianOvrevage opened this issue Jan 16, 2017 · 2 comments
Open

Cannot get "YAHOO/OL_TEL" from Quandl for example. #12

StianOvrevage opened this issue Jan 16, 2017 · 2 comments

Comments

@StianOvrevage
Copy link

I'm having trouble adapting the FX examples to regular stocks, and cannot find any examples or documentation on how stocks would work.

The stock I'm testing with is TEL on Oslo Bors and it's available on Quandl as https://www.quandl.com/data/YAHOO/OL_TEL

I have added a ticker definition in /usr/local/lib/python3.5/dist-packages/findatapy/conf/time_series_tickers_list.csv:

stocks,quandl,daily,TEL,OL,close,YAHOO/OL_TEL,5:00pm Oslo,,,

and request code as:

md_request = MarketDataRequest(start_date='year', cut='OL', category='stocks', fields=['close'], data_source='quandl', tickers=['TEL'])

But I'm getting this error:

2017-01-16 16:36:18,469 - findatapy.market.datavendorweb - INFO - Request Quandl data
error
Traceback (most recent call last):
  File "finapi.py", line 7, in 
    df = market.fetch_market(md_request)
  File "/usr/local/lib/python3.5/dist-packages/findatapy/market/market.py", line 155, in fetch_market
    return self.market_data_generator.fetch_market_data(md_request)
  File "/usr/local/lib/python3.5/dist-packages/findatapy/market/marketdatagenerator.py", line 139, in fetch_market_data
    data_frame_agg = self.download_daily(market_data_request)
  File "/usr/local/lib/python3.5/dist-packages/findatapy/market/marketdatagenerator.py", line 434, in download_daily
    data_frame_agg = self.fetch_group_time_series(market_data_request_list)
  File "/usr/local/lib/python3.5/dist-packages/findatapy/market/marketdatagenerator.py", line 378, in fetch_group_time_series
    data_frame_group = result.get()
  File "/usr/lib/python3.5/multiprocessing/pool.py", line 608, in get
    raise self._value
  File "/usr/lib/python3.5/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/usr/lib/python3.5/multiprocessing/pool.py", line 44, in mapstar
    return list(map(*args))
  File "/usr/local/lib/python3.5/dist-packages/findatapy/market/marketdatagenerator.py", line 339, in fetch_single_time_series
    data_frame_single = self.get_data_vendor(market_data_request.data_source).load_ticker(market_data_request)
  File "/usr/local/lib/python3.5/dist-packages/findatapy/market/datavendorweb.py", line 81, in load_ticker
    for i in range(0, len(fields)):
UnboundLocalError: local variable 'fields' referenced before assignment
@saeedamen
Copy link
Contributor

Hi @StianOvrevage - I think you might need to add a 'stocks' category in time_series_categories_fields.csv as well?

@StianOvrevage
Copy link
Author

I will check, thanks!

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