Hi Folk:
I am new to the QuantConnect and not very knowledgable with C# and the API . I am able to find the past 1hr low of a FX price by storing the price in the RollingWIndow of 60minutes and find the lowest price in that 60 minutes. However, I would like to store the price between 61minutes ago - 300 and find the low in there. Anyone has any ideas how to do that and would like to share your idea will be reatly appreciate. This is like looking for the previous Sin wave and current Sin wave, I would like to know whether we see the wave before
Thank you very much for any suggestion or ideas.
James Smith
I think I understand what youre asking for. Could you not just use a longer window? Something like:
var window = new RollingWindow<BaseData>(1000); window.Where(w => w.Time > DateTime.Now.AddHours(-300) && w.Time < DateTime.Now.AddHours(-60)).Min( w => w.Price);
James Smith
Also, If you're not using these already you might find the Min and Max indicators useful.
var min = MIN("APL", 60, Resolution.Minute); var max = MAX("APL", 60, Resolution.Minute);
Herman Lam
Thank you very much James. This one seems to be easier to understand that the early code. I will try it out.
Herman Lam
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!