Hi everyone,
I'm new and just starting out with QC algorithms. I was wondering if there are any sample algorithms (or a built in utility class) that can identify support and resistance levels given a set of bars.
Thanks in advance,
Buddhika
Hi everyone,
I'm new and just starting out with QC algorithms. I was wondering if there are any sample algorithms (or a built in utility class) that can identify support and resistance levels given a set of bars.
Thanks in advance,
Buddhika
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.
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.
Hi Buddhika ! Great that you're exploring the platform. LEAN code is open source, in Github, you can run it locally from visual studio.
Lots of sample Alogorithms in the "Algorithms" folder:
https://github.com/QuantConnect/Lean/tree/master/Algorithm.CSharp
Hi Buddhika,
QCU do not have examples nor a build-in class for support/resistance.
You can ask for a future implementation at Lean in Github.
Hopefully a community member has implemented it and will share.
Thanks for the replies Alexandre and Marco. I'm surprised it hasnt been implemented yet. I will request for a future implementation.
In the meantime I will try to write my own implementation since my day trading strategy relies heavily on identifying support and resistance which I would like to automate since I wont be able to watch the trades during the day. I'm a java programmer so there is a small learning curve with C#. I will share what I come up with the community.
Hey Buddhika,
I have a suggestion on how one might find supports and resistances.
We can find the local maxima/minima over a fixed look back period like 50 bars. We can identify these maxima/minima by finding the points which are either locally at the top of a "hill" or locally at the bottom of a "trough".
You can then list all these extrema points. If 2 or more of these points are within some price factor like 1%, we've found a price level.
Hi @Rahul Chowdhury, if you dont mind., could you share the same Algo in C#?
Hey Saravana,
Here is the same algorithm in C#. I restructured the algorithm a bit to accomodate it to C#.
Rahul Chowdhury Thanks a lot
Hi Michael,
First, we need to use self.SMA instead of SimpleMovingAverage to initialize the indicator because indicators created through self.SMA are automatically updated, while custom indicators through SimpleMovingAverage either need to be registered or manually updated (docs). Then, we need to store these in a dictionary as an entry for each Symbol. Please see the attached backtest for the changes.
Best,
Shile Wen
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!