Genetic optimizer with walk forward

Questions about MultiCharts and user contributed studies.
familytrading
Posts: 33
Joined: 24 Sep 2009
Location: Monterey, CA
Been thanked: 3 times
Contact:

Genetic optimizer with walk forward

Postby familytrading » 23 Apr 2011

OK, I have two paid installations of MC and have used it in the past with the external Grail application. Don't get me started on 9.0, I am just too old to learn C# and if I wanted C# I would have moved to NT and not be stuck with any proprietary languages.

OK, here are the questions:

1. Under External Grail we used 50 populations and 50 generations. When I do the analysis for my 11 input strategy, your numbers that populate are > 250K for each and of course, the program runs out of memory. (I have 15 GB of memory). Do I put in 100 or 50 in each of these?
2. Crossovers I am used to are 0.5 and you guys use 0.95
3. Mutations I am used to using 0.01 and you guys use 0.05. Are the above two just personal favorites.
4. When I run the walk forward with Genetic optimization, it looks like I should use the basic version. What is incremental for?
5. OK, now I run a basic version for 30 % of my data and it takes 10 hours, a couple of questions:

a. Where do I find the parameter set to use after the optimization or walk forward?
b. How do I export this file to Excel so I can plot the various functions?
c. What parameter set should I use?

Even without a walk forward, how does one pick the parameter set used? Surly you wouldn't just pick the best one. I am used to having plots of equity curves of each parameter set and choosing from looking at the graph.

Finally, I am using 7.0 Beta version and the results are way different for the same strategy over the same parameter space when I use external Grail and your Genetic optimizer. I would think that they should be at least close, give the same number of generations and populations. Is the seed that you use different?

Thanks in advance.

I am sure these are trivial questions, but I have spent the last hour on the forum searching and found nothing.

PS: I think that a button should be added to the walk forward optimizer report that does export to a location in a Excel format.

My cut and paste is not large enough to make this happen.

User avatar
Stan Bokov
Posts: 963
Joined: 18 Dec 2009
Has thanked: 367 times
Been thanked: 300 times

Re: Genetic optimizer with walk forward

Postby Stan Bokov » 26 Apr 2011

familytrading wrote:OK, I have two paid installations of MC and have used it in the past with the external Grail application. Don't get me started on 9.0, I am just too old to learn C# and if I wanted C# I would have moved to NT and not be stuck with any proprietary languages.


Hi familytrading,

Thank you for your comments and thank you for becoming a member of the MultiCharts community. I will address every point, so this may be a somewhat long post.

First, I want to mention that MultiCharts makes Exhaustive and Genetic Optimization (with or without anchored/not-anchored walk-forward add-on) available as a standard tool for traders to use. It is not the specialization of our software to perform optimizations, that is why you may not see as many features as you are used to seeing in an external application designed for one purpose alone - optimization. The built-in functionality is enough for some users. Some users used the Grail WFO until it was acquired by TS in 2010 and they stopped supporting MultiCharts. Users can use other external applications to obtain more functionliaty - for example, one of our partners "Diamond Backtesting" (http://www.profsoftware.com/bt) provides a sophisticated tool that is compatible with MultiCharts.

Our implementation of the genetic optimization is based on the Genetic Algorithm library (GAlib), a description of which can be found here - http://lancet.mit.edu/galib-2.4/Overview.html. This page can provide answers to what exactly happens inside the algorithm. A more general view of how it functions can be obtained from http://en.wikipedia.org/wiki/Genetic_algorithm


1. Under External Grail we used 50 populations and 50 generations. When I do the analysis for my 11 input strategy, your numbers that populate are > 250K for each and of course, the program runs out of memory. (I have 15 GB of memory). Do I put in 100 or 50 in each of these?

- As with any external application (especially one that does not support MultiCharts anymore) I am not sure exactly what goes on inside their algorithm. In terms of usage, we do not have a "number of populations" input at all. We have Number of Generations and Population size (attached screenshot GA1.png). As for usage, i.e. what you would like to enter there..... I cannot advise you with any precision. You should try using 50 and 50, just like how you did in the other application and see if the results it yields are fitting for your needs.

As for running out of memory - it doesn't matter how much memory you have on your computer at the moment, since MultiCharts is a 32-bit application, each process can use a maximum of 2 GB of RAM at any given time. This issue has been discussed at length here - viewtopic.php?f=1&t=8394. In short, we are planning to release a first working version of a 64-bit MultiCharts, which will be able to use more than 2 GB of RAM. This should solve any running out of memory issues you are currently experiencing.

2. Crossovers I am used to are 0.5 and you guys use 0.95

- You can specify the one you like.

3. Mutations I am used to using 0.01 and you guys use 0.05. Are the above two just personal favorites.

- Again, you can specify the one you like.

4. When I run the walk forward with Genetic optimization, it looks like I should use the basic version. What is incremental for?

The main difference between the two is how new generations are formed. This is discussed at length through the link I provided above, but here is a short excerpt.

Simple - uses non-overlapping populations and optional elitism. Each generation the algorithm creates an entirely new population of individuals.
Incremental - each generation consists of only one or two children. The incremental genetic algorithms allow custom replacement methods to define how the new generation should be integrated into the population. So, for example, a newly generated child could replace its parent, replace a random individual in the population, or replace an individual that is most like it.

5. OK, now I run a basic version for 30 % of my data and it takes 10 hours, a couple of questions:

a. Where do I find the parameter set to use after the optimization or walk forward?

- The set is contained in the report that is shown after optimization completes.

b. How do I export this file to Excel so I can plot the various functions?

- With the Walk-Forward report, you need to select all, and then Copy-Paste the values into Excel.

c. What parameter set should I use?

- Entirely up to you. Usually people try to maximize Net Profit, although sometimes you may try to minimize the number of trades, etc. This is determined in the Settings before you begin the optimization. The numbers you get in the end are ranked from best to worst according to the criteria that you chose before you clicked "OK" to begin optimization.

Even without a walk forward, how does one pick the parameter set used? Surly you wouldn't just pick the best one. I am used to having plots of equity curves of each parameter set and choosing from looking at the graph.

- Not sure what you mean "wouldn't pick the best one". I would apply the optimal parameters, since that is what I was looking for. What you should pick, I can't know that. As for equity curves, I have a couple things to say about this particular report. It is far from perfect, anyone that sees it, can say that with confidence. But it is what we have at the moment, any improvement will require time and energy. Right now, the report of Walk-Forward optimization does not have any buttons for exporting to Excel (regular optimization report does), it does not have automatic application of inputs after a double-click (reg. report does), it does not have sortable fields, and definitely no fancy stuff like equity curves (like Strategy Performance Report does). You can see the attached WFOReport.png. We realize it's not the best report out there, but at the moment there other more pressing issues to take care of.

If you want improvement, please add a feature request to our Project Management system (https://www.multicharts.com/pm/), and other users can Vote for this issue to illustrate its importance. The more votes, the more likely we will implement it soon.


Finally, I am using 7.0 Beta version and the results are way different for the same strategy over the same parameter space when I use external Grail and your Genetic optimizer. I would think that they should be at least close, give the same number of generations and populations. Is the seed that you use different?

- Very possible. The algorithms can be very different, we have no way of knowing what happens inside another proprietary product. Ferraris also drive faster than Toyotas, on average :)

I am sure these are trivial questions, but I have spent the last hour on the forum searching and found nothing.

- Your questions are very valid, since users need to know what actually happens inside, and we are open to that.

PS: I think that a button should be added to the walk forward optimizer report that does export to a location in a Excel format.

My cut and paste is not large enough to make this happen.

- Please "feature request" it in the PM.
Attachments
WFO_report.png
WFO_report.png (172.24 KiB) Viewed 449 times
GA1.png
GA1.png (50.99 KiB) Viewed 728 times
Last edited by Stan Bokov on 27 Apr 2011, edited 1 time in total.
Reason: added screenshots

familytrading
Posts: 33
Joined: 24 Sep 2009
Location: Monterey, CA
Been thanked: 3 times
Contact:

Re: Genetic optimizer with walk forward

Postby familytrading » 26 Apr 2011

Thanks for your detail reply. This gives me a great start. I do have the Diamond system so I may use that also.

Thanks again. Very excellent response.


Return to “MultiCharts”