Hey everyone, another #IdeaStreams episode is out and this time we're looking at what's been causing the recent rush to gold.
You can find the video here!
Using a research notebook and FRED data we compare and analyse the relationship between gold prices, bond yields and expected inflation. Then we seamlessly copy and paste the code over to create a strategy and run a backtest.
You can find the code and backtest with the rolling regression below.
Happy coding!
Ollie
Mark hatlan
It hasn't necessarily been a recent rush in gold, I think the price just popped this year due to the virus and people diversifying away from equities. I also think its because countries have been acquiring huge stock piles of gold in recent years while the price has been depressed, therefore providing a bottom in price.
Russia and China have been stock piling gold a lot recently, check out their reserves in a chart. When you have massive buying occurring like that you have a strongly supported bottom, and the price can only increase if they keep buying. They have shown no signs of selling, only buying more. Not only have countries added to their stockpiles, but countries have been repatriating their stockpiles away from the US. Looks like Gold will be in play for the next few years.
Javier V.
Hello! Great job, congratulations.
I get a lot of errors like this in the backtest:
Failed to invoke data reader YLD.TenYrYield. Line: 2003-02-17,. Error: TypeError: Value 'str' cannot be converted to System.Decimal
How do I solve it?
Thanks!
Ollie Hooper
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 unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!