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

Chartpy - Empty chart #23

Open
lefig opened this issue Aug 10, 2019 · 3 comments
Open

Chartpy - Empty chart #23

lefig opened this issue Aug 10, 2019 · 3 comments

Comments

@lefig
Copy link

lefig commented Aug 10, 2019

Hi there,

Firstly, thank you for three excellent projects. Only recently have I tried plotting a chart using Chartpy. And this has been unsuccessful. I am struggling to figure out why the chart output is not being rendered. I get a PNG and matplotlib display that is blank. The logs are:

2019-08-10 17:38:28,860 - findatapy.market.datavendorweb - INFO - Request AlphaVantage data
2019-08-10 17:38:30,496 - findatapy.market.datavendorweb - INFO - Completed request from Alpha Vantage for ['VUSA.open', 'VUSA.high', 'VUSA.low', 'VUSA.close', 'VUSA.volume']
2019-08-10 17:38:32,513 - findatapy.market.ioengine - WARNING - Couldn't push MarketDataRequest_527__abstract_curve_key-None__alpha_vantage_api_key-x__category-None__category_key-backtest_default-cat_alphavantage_intraday_NYC_VUSA__cut-NYC__data_source-alphavantage__environment-backtest__expiry_date-NaT__fields-open_high_low_close_volume__finish_date-2019-08-10 16:38:27_377636__fred_api_key-x__freq-intraday__freq_mult-1__gran_freq-None__quandl_api_key-x__resample-None__resample_how-last__start_date-2019-08-03 16:38:28_406628__tickers-VUSA__trade_side-trade__vendor_fields-open_high_low_close_volume__vendor_tickers-VUSA_L to Redis: Error 10061 connecting to 127.0.0.1:6379. No connection could be made because the target machine actively refused it.
2019-08-10 17:38:32,749 - matplotlib.legend - WARNING - No handles with labels found to put in legend.

I would really appreciate any thoughts or suggestions.

Thanks

Fig

@saeedamen
Copy link
Contributor

@lefig have you checked the dataframe is not empty? Eg. you can print it beforehand

@lefig
Copy link
Author

lefig commented Aug 13, 2019

Hi @saeedamen ,

Thank you for coming back to me. I am still investigating but am at present unable to download any data. I get a strange error...

File "c:\work\quant\python\data\findatapy\findatapy\market\datavendorweb.py", line 496, in load_ticker
data_frame = data_frame.to_frame().unstack()
File "C:\work\python\3.6.7\python-3.6.7.amd64\lib\site-packages\pandas\core\generic.py", line 5180, in getattr
return object.getattribute(self, name)
AttributeError: 'DataFrame' object has no attribute 'to_frame'

And the code responsible:
if run_example == 1 or run_example == 0:

# downloaded S&P500
md_request = MarketDataRequest(
    start_date="decade",            # start date
    data_source='yahoo',            # use Bloomberg as data source
    tickers=['Apple'], # ticker (findatapy)
    fields=['close', 'open'],       # which fields to download
    vendor_tickers=['aapl'],   # ticker (Yahoo)
    vendor_fields=['Close', 'Open'])# which Bloomberg fields to download)

df = market.fetch_market(md_request)

@saeedamen
Copy link
Contributor

Yahoo changed their API, so pandas_datareader, which broke findatapy's Yahoo downloader. I've rewritten the Yahoo downloader in findatapy to use yfinance (pip install yfinance). If you remove findatapy and install the latest version (with yfinance too), it should work.

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