Back

Recommended practice to develop a new strategy for Lean.

I've just begun working with Lean, it's taking some time to understand the structure, but, I'm getting there. I suppose it doesn't help that C# is not my area of expertise. I've been through the examples, and I think that they help a lot to understand how it all works; however, what seems to be missing is some guidance for those who would like to use Lean for more than a simple experiment.

I think that the community would benefit from some of the developer's insight with respect to managing new projects that involve more than a single algorithm class. It would be nice to have some guidance on compartmentalizing new algorithms/strategies as standalone projects within Lean solution. It seems like these efforts should be segregated from the main source tree.

This guidance would probably also help with contributing back to the community. I may not choose to contribute my algorithms, but, I may want to make new brokerage models or data sources available. Do the developers have a preference for how this should be done?
Update Backtest








Hey Jordan! Good thoughts and thank you for your feedback. Perhaps the best example of a substantial algorithm framework is under the University "AlgorithmFramework" template. This breaks up an algorithm into several pieces and separates the concerns of the algorithm into risk control, alpha generation, and execution.

I gave a talk about this to a quant group in Canada. I'm hardly an expert at this but it might help you get started - https://www.youtube.com/watch?v=Si6Ql8zqkLA

I'd recommend any algorithm used for live trading uses this infrastructure as it forces you to fully think through the risk and execution components which are often overlooked.

The best place to contribute complete frameworks/code bases or code components is definitely right here! Please share your code snippets with a little example algorithm and I will tidy and import them into the QC University!
1

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.


Thanks Jared. I think that this is helpful, but, what if the goal was to run this standalone with just the engine? What would be the way to package it within the VS solution?
0

Inside the engine there's a "Algorithm" project - check out the getting started tutorial here :)
https://lean.quantconnect.com/docs#topic13.html
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.


Thanks, Jared. Somehow, I guess I just assumed that this project was part of the core platform. I saw the 'Examples' folder but I didn't make the connection that this project represented the answer to my question. Sorry for the distraction.
0

Not at all! Let us know how to help.

I'd recommend to put Lean specific issues or questions into the Github list - that way we can track it better - https://github.com/QuantConnect/Lean/issues
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