Back

Import data from Yahoo (not Quandl)

Hi. I am trying to get some custom data from Yahoo, but I can't get it to work properly. I cannot use Quandl as they are missing some stocks I need.

I'm a beginner at this, but it seems the data needs to be sorted ascending, so I cannot use the csv from ichart.finance.yahoo.com directly? I used YQL and sorted the data, but it returns in JSON format so I tried to change it into CSV and pass to Reader. Not sure if this is the right way to go, but I thought it would work.

It should be a fast and easy backtest, but it takes a long time with warnings: "Your algorithm messaging has been rate limited to prevent browser flooding."

It then ends eventually saying I ran out of RAM.
Pretty sure I'm doing something wrong...

Hope someone have some time to point me in the right direction.

Update Backtest








Hmm the backtest doesn't complete so was not able to attach the code.  Can use this link maybe?
 

https://www.quantconnect.com/terminal/#open/560786

 

0

First you can attach a backtest by claking in the Attach Backtest button bellow.

Respect to the Yahoo data parsing, have you check the documentation?

 

0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


I can't attach a backtest when it won't run.

Yea, but all the examples get the data through Quandl, not straight from Yahoo, and the stocks I need are not there.
(Also Quandl are shutting down the Yahoo data from their service in June anyway).

0

Check this tutorial, is old but maybe it a can help.

Also this post has an old implementation with custom source data.

Finally, there is this implementation in the Lean repository.

Good luck.

0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Hi Herjar I think Quandl disabled the Yahoo API due to TOS changes about a month ago. You may be able to link directly to the Yahoo API. I'll have one of the team look into this and post a fix for it today or tomorrow.

0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Hi just an update: the Yahoo Finance API has been discontinued. We will remove the documentation and algorithms surrounding this feature.

0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


To say this is a disappointment is an understatement.  I wonder how the academic universe is going to react to Yahoo yanking their API.

0

Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed