Using Overlays And Keeping Notes
Before we back-test Trend Trader v1.01, lets take a look at Chart and Indicator Panel overlays. This very useful feature lets you graph, over time, the value or true/false state (of conditions) of Named Terms; the state (i.e. has it or hasn’t it been triggered) of Strategy Activation and Trading Rule conditions; and the number of securities in Security Lists and List Selector lists.
Overlays are yet another way that RuleTrader can tell you what’s going on in your Trading Spec, alongside Trading Performance Reports, Gain/Loss symbols, the Chart Status Panel and the Usage In Test column, which were introduced in the first part of this tutorial. Because they show you the values and state over time of your Spec’s definitions, they provide a powerful insight into what your Spec’s doing, whether it’s working as expected, and how it can be improved.
To create a Chart Indicator, open the Chart Settings tab on the Dashboard and click the Chart Overlays button on the right-hand side of the dialog. In the ‘Overlay Settings’ dialog that appears next, in the ‘Add Overlay’ group, use the Source drop-list and the Add button next to it, to select and add the following definitions from your Trading Spec:
- Long Channel Rising
- Short Channel Rising
- Buy Rising Trend\Still A Low Price (which selects the Private Term in the main rule definition)
- Buy Rising Trend\Was A Low Price
As you add each term, they will be listed in the ‘Selected Overlays Styles’ group, as shown below. Here you can change the stye and colour of each overlay, as it will be shown on the Chart. A full explanation of each option is available here.

Chart overlays are great for showing the true/false state of conditions in your Trading Spec (as we have selected here) but they are less useful for showing values, unless those values are in price units. This is because the Chart’s vertical axis is scaled for prices.
If you do want to graph values, the Indicator Panel overlay is the way to go. So click Ok repeatedly to exit the dialogs and the Dashboard. Then, on the Chart, right-click to open ShareScope’s pop-up menu and select Add Indicator then ShareScript Indicator:

In the ‘Add ShareScript Indicator’ dialog that appears, click on RuleTrader Value Indicator to select it, then click Ok:

You’ll then see a similar ‘Overlay Settings’ dialog to the one you just used for Chart overlays, which is used in the same way. Except this time, select and add these value Source definitions from your Trading Spec:
- Growth Shares list length
- Growth Shares\Quality Companies list length
- Growth Shares\Small Cap list length

This will show us how many shares are selected by the strategy’s List Selector and its Selector Terms. Note that the styles you’re now offered are appropriate to graphing values, as opposed to the condition true/false states that we’ve specified for display as overlays on the Chart. An explanation of these styles is available here.
Using Rule Highlights
Another graphic that RuleTrader provides is Rule Highlights. These provide a simple, colour coded means of indicating which Trading Rules are responsible for which trades. Before we start the back-test, let’s set them up by opening the Chart Settings tab in the Dashboard, again, then clicking the Rule Highlights button to display the highlights dialog:

The buttons on the left are tab buttons allowing you to specify separate highlights for each Trading Strategy in your Spec. As we have only one strategy, there’s just the one button. The selected strategy’s rules are displayed in the centre with a colour selector to choose the highlight colour, and a checkmark to enable highlights for selected rules.
For now, check all the rules (or click the Select All button) and select whatever colours you fancy, before pressing Ok twice to return to the Dashboard
Keeping Notes
Just before running the back-test, press the Clear Console and Show buttons to display the Trend Trader v1.01 strategy in the Console. This is a good habit to get into because after we’ve run the back-test and displayed our reports, we’ll then have a record, in the Console, of how the Spec was defined, the results of running the test, and the reported results after running the test.
In other words, a complete record of everything we need, as per golden rule A: Keep records. You can then press Ctrl-A to select everything in the console before cutting and pasting it into your favourite note-keeping app. There you’ll also be able to add any notes, ideas or thoughts you have, as you review your Spec’s performance, before saving it in a directory that you’ve reserved for this purpose. We like to use the same directory that batch test results are stored in, so all the results are kept in the same place: \ShareScope\ShareScript\Output\RuleTrader\Test Sessions\Batch Tests\Results
Records are at the heart of the proven empirical approach that took humanity from Michael Faraday’s invention of the toy-balloon in 1824, to Artificial Intelligence via space-flight and quantum physics in just 20 decades. It worked for them, so why not make it work for us?
Running The Back-Test & Saving The Trading List
All the parameters for the back-test should still be set up from the last test, but let’s use a new one. This is the Securities to test parameter, which you should change to ‘All selected securities and save trading-list to file’. Then in the Trading-list file field immediately below, click the D(efault) button to the right of the field and a name for the file will be automatically created, based on the test settings. Handy.
The London Stock Exchange, and thus the ShareScope database, is in a constant state of flux, with companies entering and exiting the market and company data changing on a regular basis. These changes mean that a back-test run at two different times may not select exactly the same trading-list. This is particularly true if you’re sampling the list, as the disappearance/addition of one share will change every share in the cohort, sampled above that changed share, as they all move up or down one place in the list to accommodate the change.
A large part of evolving a Trading Specification is to compare the performance results of one variant with the results of another. So it’s very sensible to remove this source of variability by getting into the habit of saving the trading-list from the first back-test you run, then using that list for all future tests (provided you don’t change the List Selector criteria between variants, obviously). It also reduces the time to run tests, because you’ll see from the timing report (displayed at the end of each test) that list selection adds significantly to the overall test time.
So now you’re all set up, just hit Start Back-Test, wait 90 seconds, then run the Account and Period reports, as before. You should end up with something like this:

We’ve now gone from +23% CAGR on 42 positions to -44% on 628 positions! Clearly something’s gone wrong. In the next section we’ll look at the features RuleTrader provides to trouble-shoot issues like this.
Interpreting The Overlays
Meanwhile, let’s have a quick look at the Chart and Indicator Panel overlays, which were generated in the test:

At the bottom of the Chart you can see the overlays that represent the conditional state of some terms in the Spec, whose names are labelled on the left of the chart. Depending on the style you selected for the overlays, the true/false state of these terms is either represented by the presence of a line (true), or its absence (false), as illustrated above; or by the line being rendered in one colour for true and another colour for false.
We used the Indicator Panel to show a graph of values over time, in this case the number of shares in each List Selector. If you need to edit what’s shown, just right-click on the Indicator Panel, choose ‘Edit Displaying…’, select the RuleTrader Value Indicator option in the dialog that follows, and you’ll then be taken back to the Overlay Settings dialog.
In the image above, overlays are being shown for the 4imprint Group. Note that overlays are only updated and displayed for the period when this share was selected for the Trading List on 1st April 2024. Because this limits the data available to us, it’s a good idea to include some non-tradeable instrument – such as an index – that is always selected. This way you’ll have one share whose overlays provide a full history of data over the entire period of the test.
Adding a Shared List Selector
To see how this works and to learn about shared lists, rules and terms, open the Dashboard, select your Trend Trader v1.01 specification, and click the Edit button below it. In the Trading Specification Definition dialog, click on the Shared Lists tab button. Shared Terms, Rules and Lists are Named Terms, Lists Selectors and Trading Rules that can be shared between strategies. We’ve only the one strategy, so creating a Shared List is somewhat artificial but it demonstrates how it’s done. The list selector we’ll create is:
‘Index’ list is the empty list PLUS the instrument “FTSE 250 (MCX)”. These securities are selected once
To create it, in the Shared Lists tab click the Do It! button next to the Create option, as usual, then enter the following. Notice that to create a list of only one, specified security, we first need to create an empty list to act as the list container, then add the security to that list. We’ve used the FTSE 250 index, but you can use any one you like
“Index” → empty list → PLUS a security → security from a ShareScope list → a non-share instrument list → All Indices → FTSE 250 (MCX) → end list expression → once
Once a shared List Selector or Trading Rule is created, it needs to be added to the strategies that will use it. Note, however, that shared Terms don’t need to be added in this way – they are used by simpy referring to them by name.
To add a Shared List or Rule to a strategy, we simply copy and paste it. So tick the checkmark next to the Index list definition, choose Copy selected from the drop-down and click Do It!. Then click the Trading Strategies tab selector, press Edit next to the Trendy strategy definition, then click its Strategy Lists tab selector, which is where we’ll be inserting the new Index list. In the drop-down, choose Paste and click Do It! You’ll then see the following dialog:

Here you have two options. You can either Link the definition, or you can Copy it. Linking means that any edits to the definition can only be made in the Shared Lists tab and those edits are then replicated everywhere the List Selector has been linked. It will also result in faster back-tests, as the shared definition only needs to be evaluated once. Copying makes an independent copy of the shared definition, which can then be edited where it has been pasted. Future edits made to the shared definition will not affect the copy.
In this case we’ll be linking the definition into the Trendy strategy, so just click Ok and you’ll see the Index definition is inserted as a new list selector with LINKED next to it, where the Edit button would otherwise be (if you’d copied it you’d see the Edit button instead of LINKED). Job done, so just exit the Wizard and allow the specification to recompile, before exiting the Dashboard
Next, we’ll learn how to use Execution Reports to find and fix whatever went wrong with our Trading Spec.