This section shows how to create, backtest and optimize an example trading system without doing any programming.
First, click on the button in the upper-right of a chart, then go to the tab "Probacktest & Automatic trading" and click "New". The following window will appear:
We are by default on an "Assisted creation" mode that allows you to create your strategy without having to write a single line of code. You can also create your own code by clicking on the label "Creation by programming" of the window displayed above.
The "Assisted creation" window is composed of several buttons (Buy, Sell, Short, Exit short) which allow you to define your buying and selling conditions. You can set stops and targets by clicking on the corresponding buttons. Finally, "Generate code" to automatically generate the code for your backtest!
Example: Let's create a strategy based on the Stochastic momentum index. We first display a simple moving average on the price and the SMI indicator.
First, click on the button. Then click "Backtesting" in the top right corner, click "New" and choose the "Buy" button to define your buying conditions. Finally, click on the SMI chart. The following window will appear:
Select "Stoch momentum 1" "Cross Over" "Signal 1"
We will now add another condition clicking on the button "Add condition". We click this time on the price chart. The following window will appear:
Select "Price 1" ">=" "Moving average 1" and click on the "OK" button.
Let's now define how to sell the buying positions by clicking on "Sell" and then on the Stochastic chart. Choose "Stoch momentum 1" "Cross Under" "Moving average 1" and click on "OK".
Then, we set the parameters illustrated below:
To define the stop strategy, we click on "Stops & Target" and we choose the settings below:
Click on the "OK" button. The program is done, you just need to give a name to your backtest such as "Stochastic momentum" and click on "Generate code".
To perform the backtest, click "ProBacktest my system". A chart containing the equity curve of the backtest will be displayed as well as detailed report containing performance information:
You can modify the backtest to improve its results. Click on the wrench icon of the Equity curve highlighted in yellow and then on "Modify ProBacktest":
Let's create a variable instead of a fixed value for the moving average. To do so, remove the number "150" from the program and write "number" instead. Then click on the "Add button" of the field "Optimization parameters" and choose the settings below:
Finally, click on the button "ProBacktest my system". After a few seconds, you get an optimization report that gives you the values that give the best results for the historical data set examined.
To continue improving the system, you could try to add new conditions. You could also modify the type of stop used or add a profit target.
With creation by programming, you can apply far more sophisticated functions by using our Functions library which you can access by clicking on the "Insert function" button as shown below.
A window appears with all the functions available with ProBacktest module and corresponding help text. By clicking on "Add", you can insert this function in your program at the location of the mouse cursor.