Hi, when doing a History request I am getting an error: `AttributeError : 'Series' object has no attribute 'volume`. I was having some trouble earlier with some tickers giving other errors and was able to resolve them with suggestions in this postÂ
https://www.quantconnect.com/forum/discussion/8229/object-not-callable-error-midway-in-backtest/p1but am now having some additional problems. I attached a backtest with the offending lines commented out (lines 76 and 77, with lines 78 and 79 also being commented out as example of what I was trying to do). If anyone would know the issue it would be greatly appreciated. Thanks.
Derek Melchin
Hi Dahui,
This error occurs because there was no trading for NOB during the time period we perform the history request. See the logs of the attached backtest for reference.
To avoid this error, we should ensure the history DataFrame has the column 'volume' before accessing `bar.volume`. We remove the column volume if all values are zero to reduce the data frame size.
Derek Melchin
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.
Dahui
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!