i am having trouble with using the Fundamental object to get fundamental data in backtesting environment… the trouble is i get the historical Price to Book ratios but the values are incorrect! they are all thesame… any ideas why?? here is the backtest code
from the attached backtest in the log you can see that the mean value of df which is 1000 ratios is same as the last one always… this confirms that the ratios are the same whereas in actuality all the values should be different as prices changes daily
Mia Alissi
Based on the information provided in the extracts, it seems like 'Pavel' is trying to get historical fundamental data in a backtesting environment. However, according to the information from the QuantConnect Documentation, it's currently only possible to get historical fundamental data from the Research Environment.
In the backtesting environment, you can access the most recent fundamental data using the
Fundamentals
property of theEquity
objects in your algorithm. However, this will not provide historical data.Here is an example of how to access the most recent fundamental data in the backtesting environment:
If 'Pavel' needs historical fundamental data for his algorithm, he might need to consider a different approach. One possible workaround mentioned in the forum discussions is to start the backtest earlier to collect the data, but this has its own limitations as mentioned by 'Pavel'.
For more information about accessing fundamental data, 'Pavel' can refer to the QuantConnect Documentation.
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.
Pavel Fedorov
what kind of object will fundamentals =
be? is that a dataframe?!
Pavel Fedorov
i think what you propose does not work …
Pavel Fedorov
your way will just give the current float value of the ratio not the historical ratios
Ashutosh
Hi Pavel Fedorov
As a work-around, you can use the rolling window to get rolling PBRatio and the mean of PBratio in past n days.
I double-checked the values with TradingView and they work correctly.
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.
Pavel Fedorov
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!