+1 888 340 6572 
Home/ MultiCharts/ Features/ Strategy Optimization

Trading Strategy Optimization

A trading strategy is created by taking trading concepts, ideas, and observations about historical market behavior, and implementing them into a trading system. Whenever you find an optimal solution to doing anything in everyday life, you are actually performing implicit optimization. So, people often use trading system optimization when creating trading strategies as well. Optimization tests many possible input combinations to find ones that result in the best performance. For technical information on this feature look at the related Wiki page.

What is strategy optimization?

Strategy optimization is the search for optimum parameters for predefined criteria. By testing a range of strategy input values, optimization helps select values that correspond to optimal strategy performance based on historical data.

Offering extensive choices
MultiCharts offers exhaustive and genetic optimization, as well as walk-forward testing. Each optimization type offers its own advantages and disadvantages, and each is great for accomplishing certain tasks. You can use them separately, or you can combine them to get a complete look at strategy performance.

Modern technologies that speed up optimization
MultiCharts uses multi-threading, which is a technique for distributing optimization cycles across all available CPUs. Modern computers can easily have 48 cores, which means you have 48 instances of your optimization running at the same time - a significant time improvement over having just one core. Data is loaded separately into 48 cores at the same time for fast optimization, essentially creating a virtual chart for each core. The 64-bit version of MultiCharts can easily handle huge volumes of data required for this operation, resulting in you using your time more efficiently and effectively during optimizations.

Exhaustive (Brute-Force) Optimization

Strategy optimization is done to find good parameters, and eliminate bad ones. Exhaustive optimization systematically goes through all potential combinations as it searches for the solution with the highest results for the criteria you chose.

Maximum speed of optimization
You can find inputs that maximize net income, minimize drawdown, or result in fewest trades. The amount of time the exhaustive optimization feature needs to find the solution relates directly to the number of possible combinations it needs to test—the more combinations you have, the longer it will take. If only a few parameters are tested for a short range, this method is definitely optimal for finding the best inputs. Also, in MultiCharts optimization is spread across all available CPUs, which means your optimization speed will increase with the number of cores in your computer. This method of spreading the work across CPUs is called multi-threading.

Exhaustive optimization vs. Genetic optimization

Each optimization type has its benefits and drawbacks. You must choose the right tool to get the job done, and find the result you need.

Different tools for different needs
If you are testing many possibilities, exhaustive optimization takes a very long time—even with multi-threading. The advantage of exhaustive optimization is that it is guaranteed to find the absolute optimal inputs in the testing range, but the drawback is that it takes a very long time if many possibilities are tested. Therefore, it should be used where the number of possibilities is relatively small, or where you must find the absolute best solution. Another nuance is that the absolute best inputs might actually be an outlier, which does not result in good performance on a consistent basis. Genetic optimization addresses this issue because it performs strategy optimization differently.

Optimization Report

This report shows the optimization results, and you can filter output combinations by one or more criteria. For example, to find a strategy with the maximum net profit and minimum max drawdown—first sort by net profit in ascending order and then by drawdown in descending order.

Custom Fitness Function Optimization

You can set your own custom criteria for which for strategy optimization. Custom criteria can be written directly in PowerLanguage or in Java script.

Optimization with multiple conditions
With this feature you can optimize using several conditions, as opposed to just one. For example, you can find a strategy that combines the greatest profit, lowest drawdown, and the highest percentage of profitable trades. You can use custom fitness function optimization in regular and portfolio backtesting—as well as with genetic and exhaustive trading system optimization.

PowerLanguage vs Java script approaches to create custom fitness functions
PowerLanguage has a keyword called SetCustomFitnessValue. This word can be used with other keywords, such as GrossProfit and TotalTrades, to create a custom equation for which your strategy will be optimized. You can also create a similar equation in Java script, if you are more familiar with that language. More specific information is found on the related Wiki page.

3D optimization graphs

3D optimization graphs give visual representations of how the strategy parameters affect trading performance. The 3D graph reveals most robust parameter zones, and is a great tool for avoiding over-optimization, which also known as curve-fitting.

Avoiding over-optimization
A strategy that has abrupt performance breakdowns with only small parameter changes cannot be considered robust. You can superimpose results of different optimizations onto each other to compare results, and see if the optimal inputs you found are confirmed by other tests. You can use superimposition to compare genetic and exhaustive optimization results, and you can evaluate how robust your findings are. 3D surfaces can be drawn by any criteria available in the optimization report—for example net profit, percent profitable, and max drawdown. Relevant input and output values are displayed when the mouse cursor hovers over a particular point on the graph’s surface.