Getting historical opening and closing prices

Hi everyone,

I'm new in QuantConnect and I would be happy to get some help :)

I've seen another discussion on the forum about getting historical closing price, using rolling window feature. I didn't understood this feature (looked in the documentation but couldn't find it), and the solution was given in python while I'm using c# to which I didn't get to 'convert' (the code).

If someone can explain or refer to any explanation of rolling window feature - it will be awesome!

Here is what I'm trying to do (using c#):

I have to find backwards, a tradebar (I mean a 'candle' lets say oil) which has a closing price lower than its opening price (red), and compare it to my current closing price. The problem is I don't look back for a specific amount of days but going backwards till I find a tradebar which stands in those requirements.

Any help to achive this will be very appreciated!

Update Backtest

Hi jolu,

This is a C# algorithm about getting the history open/close utilizing rolling window

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