Article Contents
Print

Test System tab

The RuleTrader Test Dashboard dialog controls all aspects of a test session

The Test Session Dashboard is where you create, back-test and refine your trading system prior to deploying it for live trading in RuleTrader Live. You can open the Dashboard dialog by clicking the Dashboard button in the panel in the top left-hand corner of the main OHLC price chart in the RuleTrader Test layout (you may need to click the ‘+’ icon in the panel to expand it first)

The Dashboard opens with the Test System tab displayed, which contains three groups of settings, which are described below.

On the left side of the dialog are a column of buttons, each labelled for a different aspect of Test Session operation. These act like tab selectors; clicking on any one of them changes the contents of the centre section (the tab) of the dashboard, giving you access to the settings and functions relevant to that button’s label.

On the right-hand side are the usual Ok and Cancel buttons. In addition, the Clear Console button clears all text from the ShareScript Console. Additional buttons are displayed depending on which tab is selected, as described in the Help for each tab. Most tabs display these buttons:

  • Start/Continue Back-Test: Pressing this button starts (or continues if a back-test has already been run) the currently configured back-test of the selected Trading Specification
  • Batch Back-Tests: Depending on the number of shares and the period of the test, running a back-test can take some time (from seconds to hours). As you refine your spec, you’ll also want to run variants of your trading-spec, where one element is changed at a time. This button allows you to set up a series (or batch) of tests and leave them to run unattended, as described here.
  • Load Back-Test: Reloads the session data from a previously saved back-test. Once loaded you will be able to see which shares were selected and traded, view the AutoTrend price channels, and the Chart and Indicator overlays resulting from the back-test, and run any additional reports you require on the back-test data. Please note that, when you’ve loaded a test session, any changes you make to the Reports settings (e.g. to run a report against the session data) only exist while that session data is loaded; they do not affect your normal report settings.
  • Save Back-Test: This button is displayed if a back-test has been run. It allows you  to save the back-test results to disk, so they can be reloaded and reviewed, and reports run on the results, at a later time.
  • Reset Back-Test: This button is displayed if a back-test has been run and allows you to clear the back-test and reset the system ready for a new test

Trading System

This group allows you to create, select, edit, delete, rename, copy, import/export, or show your Trading Specification in the Console. For further information please refer to the Help topics on Creating & Editing Trading Specifications

Test Scope

Here is where you specify the period over which the Trading Specification (selected from the drop-down in the Trading System group) will be back-tested, how often rules will be evaluated, and the securities that will be tested. The settings are as follows.

Choosing When The Test Starts And How It Stops
  • Start test on: Specifies the date when the back-test starts
  • Stop test at: Specifies the condition which will stop the back-test. There are two sets of options:
    1. The first set of options, above the horizontal line, define a back-test period. They can be used with single-share tests or tests that select lists of shares:
      • end of the data: The test will stop at the last day for which OHLC data is available
      • specified date: The test will stop at the date specified in the Stop Parameters dialog (see the description of the Stop Parameters button below)
      • end of one year / month / day: The test will stop at the end of the selected period, after the start-date
    2. The second set of options, below the line, define an event that will stop the test (the test can often then be continued). These stop-conditions can only be applied to single-share tests:
      • clicked bar: The test will run to each bar that you click, in the main Historical Price Chart. Note that RuleTrader can only respond to such clicks if the Chart’s panel is in the expanded state (click on it to expand it). If you click on a bar before the date the test has already reached (provided it is after the start-date) then the test will automatically reset and re-run from the start-date to that earlier date
      • scroll-position: The test will run for as long as you hold down the right-hand arrow on the horizontal scroll-bar at the bottom of the chart. This ‘unreels’ the test, like a film, allowing you to see, for example, how price channels develop over time
      • next hi/low: The test will run to the next high or low price point, as defined by the price-swings in the channel type specified in the Stop Parameters dialog (see below and see Chart Settings for information on how to display a channel’s price-swings). Clicking anywhere on the chart will start, and subsequent clicks will continue, the test after each high/low is reached
      • end of the trend: The test will run to the end of the trend determined by the channel type specified in the Stop Parameters dialog (see below). Click anywhere on the chart to continue the test.
      • next trade: The  test will run until any trading rule, that trades the share, is triggered. Click anywhere on the chart to continue the test.
      • named rule: The test will run until the trading rule specified in the Stop Parameters dialog (see below) is triggered. Click anywhere on the chart to continue the test.
      • don’t test: This option is useful to prevent mouse-clicks on the Chart triggering any test activity. The same effect can be achieved by collapsing the Chart’s button panel, which also prevents the Chart responding to clicks.
    • U(pdate) button: The ‘U’ button simply updates the stop criteria, set in the Stop Parameters dialog, which is displayed to the right of the ‘Stop test at’ drop-down list (for some stop conditions)
    • Stop  Parameters button: this button opens a sub-dialog where you can specify additional parameters related to the test’s stop condition e.g.:
      • The date for the stop at ‘specified date’ option
      • The rule for the stop at ‘named rule’ option
      • The channel whose price swings are used for the ‘next hi/low’ stop option
      • The channel whose trend-end will be used for the stop at the ‘end of the trend’ option
Setting The Rule Evaluation Frequency
  • Evaluate the rules every: Normally you would evaluate the trading rules in your trading system every day to get the most accurate results. However, if you are only using RuleTrader to investigate e.g. tradeable market anomalies, or to find the best factors for investing, then it is sometimes quicker (and equally effective) to only evaluate your trading rules periodically. This setting is where you specify that period
Specifying The Securities To Test
  • Securities to test: use this setting to specify which security selection method your back-test will use. The options are:
    • All selected securities: the back-test uses the securities chosen by your Trading Spec’s List Selectors
    • All selected securities and save trading list to file: As well as using the securities chosen by your Trading Spec’s List Selectors, these securities are also saved to a trading-list file, so they can be used by the next option below
    • All selected securities and load trading list from file: The securities used by the back-test are retrieved from a trading-list file, saved in a previous back-test using the option above. There are 2 advantages to this. Firstly, the test executes more quickly as the securities no longer need to be individually selected. Secondly, you are guaranteed to be comparing apples with apples when you test different variants of your Trading Spec, because you’ll be sure that your tests use the same underlying shares.
      The markets represented by the ShareScope database are in a state of constant flux, so the data is changing all the time. So running the same back-test on two consecutive days may produce slightly different results, because the shares selected by your Spec may change slightly due to these underlying data changes. The issue is amplified if you use list sampling, because the listing of a new share will shift  all shares above it, in list order, meaning the sampling process will select an entirely different cohort of shares above the introduced share.
    • Chart’s security without selection: This runs your Trading Spec against the single share currently displayed in the Historical Chart and the Spec’s List Selectors are ignored. This can be a very fast and useful way to test ideas, or look for tradeable market anomalies, e.g. against a single market index. It can also be useful when investigating why your spec has behaved the way it has in relation to a particular share. However, for this latter requirement problems can arise in two ways. The next 3 options are designed to ameliorate these problems:
      1. The share you’re focused on will no longer be selected and deselected in different list selection periods. This can be a problem if you’re trying to discover why your Spec is behaving in a certain way with the share you’re focused on.
      2. There can be a problem if your Spec uses internal benchmark lists derived from the Spec’s selected lists (see the Example Trading Spec’s Buy Lists for an example of this). Obviously these won’t work because the List Selectors are being ignored.
    • Chart’s security without selection (get benchmark lists from file…): With this option the List Selector lists are loaded from a previously saved trading-list, which can then be used by your Spec’s benchmark lists. For clarity, with this and the following options, the system still only back-tests the selected share i.e. it only evaluates the trading rules against that share’s data.
    • Chart’s security if selected (get benchmark lists from selected lists): This option only back-tests the focus share during the periods it is selected by the Spec’s List Selectors. In this version the List Selectors are executed as normal to generate the strategy and benchmark lists, so this results in the slowest back-tests of all the ‘Chart’s security…’ options.
    • Chart’s security if selected (get benchmark lists from file…): This option is like the previous option but the List Selector lists are loaded from a previously saved file, rather than being generated, so the back-tests are quicker to complete.
  • Trading-list file: This field specifies the name of the file to use for the ‘Securities to test’ options that require a trading-list file. The two associated buttons are:
    • … (browse) button: Opens the Windows file browser so you can select a trading list from the RuleTrader\Test Sessions\Trading Lists directory
    • D(efault) button: Generates an appropriate file-name based on the back-test settings, for example: “‘Example Trading Spec v1.00’ trading-list, sampling 1 in 3 from 1, from 01.07.2021 – 22.08.2024”. This is useful when generating a trading-list that will be saved.

List Sampling

These settings control how the source lists of shares used by your trading system are sampled. The source lists include the Trading Universe, if used, and any other ShareScope lists that are referenced in your system, except for ShareScope portfolios, which are never sampled.

Your Trading Spec’s List Selectors will then select their trading lists from this sample of shares. Please see out special help topic List Sampling for the pros and cons of sampling:

  • Sample 1 in every ___ securities, starting at number ___ :  This setting specifies the sampling period, which determines the size of the sample, and the index of the first share to be sampled (indices start at 1), which determines the cohort of shares that will be picked. So, for example, sampling 1 in 3 picks one-third of the Trading Universe and starting at:
    • 1, picks the first cohort of sampled shares
    • 2, picks the second cohort of sampled shares
    • 3, picks the third cohort of sampled shares
  • Adjust trade-size to compensate for list sampling: Reducing the number of shares that your Trading Spec can work with inevitably reduces the number of investment opportunities available to it. Checking this option increases the nominal trade size to compensate for this e.g. if you’re sampling 1 in 4 then the trade-size is increased 4x

Scroll to Top