Hi, I am looking to create an algorithm. I am new to Quantconnect and am just working through the bootcamp tutorials. I was hoping someone would be able to review what I am trying to achieve for my first algo and before I make a start give me some pointers as to the best way to structure it:
From a yet to be defined Universe of equities;
- Buys equities just before the close if the price is within 5% of HOD
- Sells equities just before the close if the price is within 5% of LOD
They would be ranked based on relative volume so the algo would hypothetically:
- buy 5 positions within 5% of high of day, with the highest relative volume.
- sell 5 positions wthin 5% of low of day, with highest relative volume
Derek Melchin
Hi Marc,
Welcome to QC! To buy right before the close, use a scheduled event and subscribe the securities to minute data resolution. Tracking the volume can be done by summing the Volume property of the TradeBars added to OnData at each timestep. Consider using dollar volume instead of just volume.
Best,
Derek Melchin
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.
Marc Heath
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!