To start the second tutorial, first close all the child windows that were opened for the first tutorial. (This is not required, it just makes it easier to keep track of what you're doing.)
Click the File / Open icon, then navigate to the Examples folder in the RealTest installation directory.
Select "Sample2.rts" and open it.
This script will use the same data file as the one in the first tutorial, so there is no Import section.
Rather than running a single test, we will now try the RealTest Optimizer.
Notice in the script above the Parameters section. This defines named parameters that can be referred to in any strategy formula.
Rather than hard-coding the 50/200 moving average crossover strategy as in Sample1.rts, the two moving average lengths are now parameters.
Press and the following dialog will appear:
For now, you can ignore most of the settings in this dialog. Just focus on the upper-left corner, where the Parameters that were defined in the script are shown. Also notice the lower-right corner, where the number of tests to be run is calculated and displayed.
Click on the check box for each of the two parameters and observe what happens to the Maximum Test Count value. Once both have been checked it should indicate that 40 tests will be performed.
Click and watch as a new Results Window appears and is quickly populated with test results. (On my machine this takes about 3 seconds.)
Besides the usual columns of the Results Window, notice that two new columns have been added, showing the value of the two parameters for each test.
Try clicking on the buttons at the top of various columns in this window and notice that these cause the results to be sorted by that column. Click the same column again to reverse the sort order. Sorting, for example, by NetProfit can give you a quick idea of which parameters would have done the best.
After sorting the results list by NetProfit ascending, double-click on the top row to open the Daily Stats Graph showing the equity curve.
Now repeatedly press the down arrow key on your keyboard and watch as the graph changes to show each equity curve from the set of tests. If, as above, you sorted by NetProfit with lowest values first, the curve will gradually look better as you proceed with the down arrow. If you started with highest first, it will gradually look worse. You can even hold down the key and let it auto-repeat to see them all in rapid succession.
Feel free to experiment with the buttons along the top of the graph (or the left and right arrow keys) too.
To get a better sense of the relationship between these parameters and the corresponding test results, click on in the Tool Bar to open the Optimization Results Graph.
If you see a graph other than NetProfit, use the button bar to select this one. Every column from the Results window can be graphed here.
Note that the X-Axis shows values for both parameters under each bar (in this example, only every other bar -- the window would need to be made wider to see every bar label).
Pressing the right mouse button within the graph opens a menu that can be used to change the display in many ways.
Selecting Sort Columns changes the graph to this:
Now we can easily see that 40/300 had the highest net profit of the combinations we tested.
Go back into the popup menu and select Heat Map.
Now you'll see this nice-looking checkerboard:
Just another view of the same data, of course, but this makes it easier to see where the best results tend to cluster (in this case, the larger values for Long MA).
(Some people like to see two-parameter optimization results displayed in a rotating 3D graph. Though these look flashy, I find that they add no new information to what already discernible from a simple heat map.)
To demonstrate the remaining capabilities of the optimization graph, please close all open windows and open the example script called Sample2a.rts.
Run this script in Optimize mode, with all three parameters checked, and then open the Optimization Graph.
It will open as a Heat Map, since that's the previous view it was shown in.
(You might want to resize the window so it looks more like this as well.)
There is one key difference as highlighted above.
We can only show two parameters (as would also be true in a 3D graph), so now the Average result (Net Profit in this case) is graphed for all tests with each shown parameter pair.
In this example, each NetProfit value is the average of the three different MidMA values for each pair of LongMA and ShortMA.
Use the right-click popup menu to change the selection of which two parameters to graph.
Now the heat map looks like this:
Now the NetProfit values are the average of the three different LongMA values for each pair of MidMA and ShortMA.
If you set both axes to the same parameter, you'll see only the averages of all results for each value of that one parameter.
That's the end of this second tutorial!
For information about all of the other features of the RealTest Optimizer, see the Optimization Dialog topic.