self._symbol = self.add_equity("SPY", Resolution.DAILY).symbol
self._bb = self.bb(self._symbol, 30, 2)
self.BB(self._symbol, 30, 2) is supported as well or just self.bb(self._symbol, 30, 2) only ?
QUANTCONNECT COMMUNITY
self._symbol = self.add_equity("SPY", Resolution.DAILY).symbol
self._bb = self.bb(self._symbol, 30, 2)
self.BB(self._symbol, 30, 2) is supported as well or just self.bb(self._symbol, 30, 2) only ?
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.
Mia Alissi
Here is a detailed answer for Dharmesh:
In QuantConnect's Python API, only self.bb(self._symbol, 30, 2) is supported for creating a Bollinger Bands indicator that automatically updates with new data. The method names in the QuantConnect Python API are always lowercase. self.BB(self._symbol, 30, 2) is NOT valid and will result in an error.
If you want to manually construct and update a Bollinger Bands indicator (not automatically updated with data), you can instantiate a BollingerBands object directly, but you'll need to call .update(...) on it yourself with each new price.
Here is an example demonstrating both approaches:
Summary:
Let me know if you need help with more indicator examples!
Sources: Bollinger Bands - QuantConnect.com, Data Point Indicators - QuantConnect.com, Indicator History Algorithm, Bitcoin as a Leading Indicator, docs writing algorithms securities asset classes us equity shorting
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.
Dharmesh Khalasi
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!