How to register VWAP consolidated indicator

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)

Update Backtest


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:

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.


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 --


Update Backtest


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.


This discussion is closed