Back

How to backtest a simple strategy with a range of configurations and rank which ones are optimal

 

Hi there,

I am a C# programmer and I want to develop a framework to test a strategy that uses an indicator with a range of different values, and have it rank which values are optimal.

So as a simple example, lets say I have an MA, and I am buying when price crosses above MA and selling when price crosses below.  I have a stop and a profit target.

I want to be able to test this out with the MA on 10 and 15, and 20 etc... so 10 to 200 in increments of 5.

Then I want to be able to do this over a range of symbols, and determine the most optimal MA value, over time, for each symbol.

I want to collect data on number of signals in each direction, number of wins vs losses in each direction, with each MA setting for each symbol.

I have watched all the bootcamp videos and looked over the documentation, and I am sure I can put together the basic strategy no problems, but I am not sure how to go about collecting the ranking data on different indicator settings over different symbols to find the best combination for each symbol, and also automating runing the test over different indicator settings eg; 10 to 200 in increments of 5.

 

Can anyone give me some direction on how to achieve this on Quant Cloud please?

I am happy to do the work, I just need to know what to learn so I can code up the solution.

Thanks for your time,

Regards,

Scotty

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 Scott Laughton ,

Unfortunately QuantConnect/Lean does not support parameter optimization. It is in our TODO list, but we are not actively working on this feature. You will have to manually change the parameters, and record value(s) used in the ranking system.

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.


This will be a killer feature if you aslo allow connection with the Machine Learning Module !!! Ranking model performances for an array of parameter with ML is really another level. 

look forward to see it!

0

Alex,

Thanks for getting back to me.  Yes I had continued to search after posting this.  I must say the Discussion Forum is very difficult to find stuff on.  Like when I click in the Search For box for the forum, it gets hijacked by the main search at the top of the page and it drops down.  And this doesn't seem to find anything of relevance in the forum.  So it seems I can't actually search the forum directly.  Is this broken? (I am using the latest Chrome browser)

I ended up just brute forcing it and going through a stack of pages of forum discussions and eventually the following discussion on Strategy Optimization:

https://www.quantconnect.com/forum/discussion/454/strategy-optimization/p1 

And found the project to do it on git:

https://github.com/QuantConnect/Lean/projects/1

and then found that it has been talked about as a TODO item for 4 years now.... and has not been started...

I also found James Lean Genetic Optimizer:
https://github.com/jameschch/LeanOptimization

I am keen to have a look at this, and see what I can do with it.

Half my problem is I don't know all the terms yet.  Like I knew what I wanted to do, but I didn't know it was called parameter optimization.

Anyway thanks for getting back to me.

Regards,

Scotty

0

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