I am trying to register a consolidated VWAP but I get:
SystemError : <bound method 'RegisterIndicator'> returned a result with an error set
fiveMinutesConsolidator = TradeBarConsolidator(timedelta(minutes=5))
fiveMinutesConsolidator.DataConsolidated += self.fiveMinutesBarHandler
self.SubscriptionManager.AddConsolidator("SPY", fiveMinutesConsolidator)
self._ema10 = ExponentialMovingAverage(10)
self._ema20 = ExponentialMovingAverage(20)
self._vwap20 = VolumeWeightedAveragePriceIndicator(20)
self.RegisterIndicator("SPY", self._ema10, fiveMinutesConsolidator)
self.RegisterIndicator("SPY", self._ema20, fiveMinutesConsolidator)
self.RegisterIndicator("SPY", self._vwap20, fiveMinutesConsolidator)
self._ema10.Updated += self._ema10Updated
self._ema20.Updated += self._ema20Updated
self._vwap20.Updated += self._vwap20Updated
self._ema10Win = RollingWindow[IndicatorDataPoint](20)
self._ema20Win = RollingWindow[IndicatorDataPoint](20)
self._vwap20Win = RollingWindow[IndicatorDataPoint](20)
Michael Manus
Pier,
QC provided a new framework for working with larger algos. their idea is to plug items together like risk manager and alpha manager ant that stuff. In works almost the same as the standard one file algo. You only have to find the right spot to put your code. That is an register indicator example from the mentioned framework:
line 125
the framework:
More register indicator examples:
Pier-Olivier Marquis
It seems that that their classical VWAP doesn't to support intraday. In their execution model they have a IntradayVwap class. This one works, I can consolidate it and put it in a Rollingwindow.
Michael Manus
There is an intraday VWAP Indicator in the documentation. If you want to use the class directly you'll have to call Update() method.
Check the examples --
https://github.com/QuantConnect/Lean/blob/cbd953437f987392f2c2e154adcb7d43d684b7f1/Algorithm.Python/EmaCrossUniverseSelectionAlgorithm.py#L102
Pier-Olivier Marquis
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!