Hey QC community,
We are changing how we calculate coarse universe dollar volume. Before - we have been providing a 30 day EMA average of the dollar volume. We are now changing this to a raw daily dollar volume. The new dollar volume field will be calculated as: (daily volume) * (closing price).
We are doing this because different users are asking for different periods of rolling average dollar volumes. The easiest way for us to accommodate everyone is to provide the raw daily dollar volumes and have users calculate the dollar volume window they want in code.
This change will be live today.
- Andrew
Andrew Hart
LukeI
Would it be possible to give an example of how one would use the new method to calculate a moving average of dollar volume? Would this moving average dollar volume look back into the previous periods?
Say the backtest started on 1/1/17, the universe selects SPY, could it get the accurate 30 day moving average dollar volume starting on day one or would it need to collect data from SPY for 30 days?
Stephane b
I second that question... Can we have an example (Ideally in Python) to calculate a window ? Thanks !
Alexandre Catarino
Stephane b, the EmaCrossUniverseSelectionAlgorithm is a good example. We just need to use the dollar volume value, instead of price, to update the indicators:
avg.update(cf.EndTime, cf.DollarVolume)
Unfortunately, LukeI, we need to collect data from the previous x days to warm up the indicator. We can do it with the historical data request. I would advise you to pre-select the symbols. For example:
Andrew Hart
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!