Back

Manipulating historical data example

To Whom It May Concern,First, let me thank you for any support you can provide me.  I have been reviewing your documentation and example algorithms for the last couple of weeks and I am struggling to get started with my project.  I have developed an algorithm in MATLAB and am in the process of converting it to Python so that I can utilize your system.  If you refer to my project, you will see most of my code converted from MATLAB to Python.  My question is, where in the framework would my code reside should I convert it?  I am struggling to fully understand how data flows through LEAN.  Really, all I need is an example program which utilizes multiple securities and references historical data to make decisions.  I know that sounds easy, but I cannot find any good examples anywhere.  Again, thank you for any assistance you might provide!
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.


Hi Patrick,

For your convenience, I have attached a simple algorithm which has a universe of multiple securities and references historical data to make decisions. In this example, we use HistoricalReturnsAlphaModel, so the alpha model considers the security's historical return when generating insights.

For more examples, I recommend checking out our GitHub repo. I also recommend reviewing our documentation and Bootcamp lesson on the Algorithm Framework to assist in the conversion from MATLAB to Python. In those resources, we explain all the framework modules and how they fit together.

Best,
Derek Melchin

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