Hi,
I'm new to object oriented programming and i am using python but i could not plot a Bollinger Band on output chart. I found the code lines:
var bb = BB(Symbol symbol, int period, decimal k, MovingAverageType movingAverageType = null, Resolution resolution = null, Func`2[Data.IBaseData,Decimal] selector = null)
Plot<T>(string chart, params IndicatorBase<T>[] indicators) where T : BaseDataI could not even apply Bollinger Band with periods=20 and k=2, so i did not try to plot it. May you write a basic sample python code or just tell where to write them ?
Alexandre Catarino
Please checkout the attached project.
The C# snippets you mencioned are translated into:
// In Initialize self.bb = self.BB(self.spy, 20, 2)
and
self.Plot("BB", "MiddleBand", self.bb.MiddleBand.Current.Value) self.Plot("BB", "UpperBand", self.bb.UpperBand.Current.Value) self.Plot("BB", "LowerBand", self.bb.LowerBand.Current.Value)
This code works in the current python framework (IronPython) and the upcoming one.
Jaco Muller
I have no idea how to accomplish this while using the Quantconnect Alpha Framework. Where does one initialize? Where does one add the series data?Â
Can someone please post an example of creating one's own chart using the framework?
Rahul Chowdhury
Hey Jaco,
Here is an example of plotting indicators while using the framework. We store the indicator data in a SymbolData object and then plot every time that indicator is updated.
Jaco Muller
thank you Rahul, I really appreciate it.
Aalap Sharma
When exactly is the  Update method called in MomentumAlpha?
ÂShile Wen
Hi Aalap,
The Update method for any Alpha Model is called on every data iteration (aka when we receive a new bar of data), right after OnData. To read more about Alpha Models, please see our docs.
Best,
Shile WenÂ
Aalap Sharma
Thanks!
Efe Yasin Akman
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!