Back

SPY Volume Rate of Change

Hello everyone,

I'm attempting to replicate the values I see on yahoofinance.com for Volume Rate of Change of the SPY ETF.  The equation is simple enough (V(0)-V(n))/V(n).  I'm trying to store the daily volume into an array and use the first and last element to compute my vROC. 

I know the list isn't built to be sequential, I really just needed to capture some of the data to compare to yahoo. I notice the volume I'm returning from my code isn't the same as the volume displayed for the same days on yahoo.  Do you know why this is?  Also, is there a more sophisticated way to store the volume data? My current setup will not store the data in correct order sequentially.

Thank you for you help!

Update Backtest








In order to save data sequentially, look into RollingWindows. This is an array of data that allows for reverse list access semantics, where the object with index [0] refers to the most recent item in the window and index [Length-1] refers to the last item in the window. 

There are also indicators provided by QuantConnect that can make the calculations easier, i.e. RateOfChangePercent and RateOfChangeRatio

With regards to the volume, the data is provided by QuantQuote. Here is their FAQ, which says a reason why the data could be different is due to different exchange data sources. The QuantQuote data can be seen via the Data Explorer.

0

Thank you very much

0

Update Backtest





0

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.


Loading...

This discussion is closed