Back

ExponentialMovingAverage - Not Dropping Items?

I have just added the ExponentialMovingAverage from the Code Library.
Seems to have a bug in the AddSample method - Shouldn't the Queue only contain the last x (_period) items?
Update Backtest








As the queue is never getting emptied this could lead to memory pressure
0

I might be wrong, but I believe if we define a queue with a fixed length it automatically pushes objects off the end of the queue? i.e. Any more than 50 strings below and the first one gets pushed off.

Queue buffer = new Queue(50);

The MS documentation isn't very helpful in this but they do say its a circular buffer. http://msdn.microsoft.com/en-us/library/system.collections.queue(v=vs.110).aspx

Otherwise for minute data its not a big issue, if you enqueued second or tick the servers would complain a little :) They are capped at 2GB ram usage per algorithm.
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.


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