Once you create a trading system, you can see that there are two buttons in the top menu of the simulator manager (Simulate and Optimize).
The optimize button allows you to create several variations of a trading system by changing the value of optimizable variables on each run.
Let's say we want to try different moving average periods. We can vary the MA period from 10 to 50 and a step of 10.
By using the optimizer, we will create five trading systems, each one backtested using a different moving average.
Steps:
- Select "Analysis -> Simulator"
- Create a new trading system ("New" button)
Using the Wizard (Under "Create a trading system using the wizard")
- Under "Buy" panel, click on "Add Rule"
- Type the following rule: close > sma(a)
- The variable "a" will be added to the optimization grid
- Set "10" as "Min", "50" as "Max" and "10" as "Step"
- Click on "Close"
Using the formula editor (Under "Create a trading system using the formula editor")
- Type the following formula: Optimize("op0", 10, 50, 10); // Create an optimizable variable "op0"
Rule1 = (close) > (sma(op0)); // Use the variable "op0" in the moving average period
buy = (Rule1); // Set buy condition
Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.