List Selectors
A Trading Strategy‘s list selectors are responsible for selecting the strategy’s trading list. This is the list of shares that your strategy searches for potential investment opportunities. The shares in this list are evaluated against the strategy’s Trading Rules to decide whether a trading-signal should be raised for any of those shares. For further information on how this happens, please refer to the help topic: How Trading Specs Are Evaluated
A strategy can contain one or more list selectors. The lists selected by them are automatically combined into a single, de-duplicated trading list for the strategy, where each selected share is entered once only. Similarly, the trading lists for all strategies in a Trading Spec are combined into a single, de-duplicated list for the whole Spec. It is this list that is shown in the Live session Share List window, with the RuleTrader Signals column showing which strategies have selected each share (when it’s not showing a trading signal for that share).
The source share lists for a List Selector can be the Trading Universe, if enabled, or any of ShareScope’s share lists or portfolios. If required, these source lists can be sampled according to the settings on the Test System tab of the Dashboard. Please refer to our help topic on List Sampling for how this is done and a discussion of the pros and cons.
List Selectors are defined in the Strategy Lists tab for the strategy. They can also be defined at the Shared level in the Shared Lists tab, then copied and pasted into each strategy, as described in the Definition Operations help topic.
Share Selection Categories
The list selection process results in 5 categories of shares:
- Added: the share has been newly added to the list (i.e. it wasn’t in the strategy’s previous trading list)
- Continued: the share has been continued from the strategy’s previous trading list (i.e. it was in the previous list and has been re-selected for the new list)
- Permanent: the share is a permanent member of the strategy’s trading list (see Managing Trading Lists & Signals)
- Reinstated: the share was not selected for the strategy’s new trading list but it has been included in the list anyway, because it has an open position associated with (i.e. bought by) the strategy
- Expelled: the share was previously in the list but has not been reselected for the new list
How To Create A List Selector
Like all Spec component definitions, List Selectors are created and edited in the DEfT Wizard and consist of two parts:
- The list construction part: describes how the list’s shares are selected. The various options available to you are discussed below but you’ll also find extensive context-sensitive help instructions in the Wizard, which will lead you through every step of the process
- The selection trigger part: describes when the list selection occurs. This can be when a condition is true or false, or only when it transitions from true to false, or vice-versa. Or the selection can be set to occur at a regular frequency, defined by the time period between list selections. Alternatively, the list can be selected once and its selected shares then do not change.
If they are selected on a time period, then they are selected immediately, when a back-test or a Live session is first started. Thereafter they are selected based on the period specified in the list selector. So, for example, if you start a back-test on the 15th January, with lists set to select once per month, then the first list will be selected on the 15th January, then on the first trading day on or after the first of each month thereafter.
List Expression Options
The options for creating a List Selector’s security list are as follows:
- Ranked list of securities: extracts a rank (i.e. a set) of securities from a security list that has been sorted on some value expression. The size of the rank is specified as a number of securities, or a percentage of the securities in the list, or a decile (1/10), quintile (1/5) or quartile (1/4) of the list. The location of the rank in the list may be specified as being at the top, middle or bottom, or at some index in the sorted list. If List Sampling is enabled and the rank size is a number (as opposed to a percentage of the source list size), then the size of the rank is automatically adjusted by the sampling ratio, to compensate for the reduced number of shares.
- List of securities whose total value: picks the top rank of securities from a security list sorted on some value expression. Securities are picked from the top of the list until the total of a value associated with each of those securities is at or under, or is just over, some threshold value. You could use this, for example, to pick those securities with the most profitable open positions that account for 80% of all current, unrealised profits.
- List of securities with trades: creates a list of all those securities that have got an open position, or have been traded at some point in the past
- List of securities that meet a condition: selects securities from some source list, that meet some criteria. The condition may test a value, characteristic or attribute of the securities in the source list. Multiple such conditions may be combined into a conditional expression that is applied against every security. The securities that pass are then added to the security list
- List of securities from a choice of lists: selects a list of securities from two or more such lists based on the results of a series of selection conditions
- Named trading list term: returns the securities in a previously defined Trading List term (defined in the Selector Term definitions area of the Wizard, below the main List Selector definition)
- Named strategy’s trading list: returns the securities in another Trading Strategy‘s trading list (i.e. the list that results from combining the lists generated by each of that strategy’s list selectors and then de-duplicating that list, so each share appears only once)
- Trading universe list: selects the Trading Universe list, which was selected from a ShareScope list according to the filter criteria defined in the Trading Universe tab in the Shared level of the Trading Definition Dialog
- ShareScope list: returns the list of securities in one of ShareScope’s built-in security lists
- Portfolio list: returns the list of securities in one of ShareScope’s portfolio lists
- Empty list: creates an empty security list. This provides a useful starting point if you want to manually construct a list of one or more shares using the list operators discussed next
List Expression Operators
A list selection expression can be created by combining lists generated using the options above, using list operators:
- PLUS a list of securities: adds the securities in one security list to the securities in another list to create a combined list of securities. Duplicate securities are removed, so the final list contains only one instance of each security
- EXCLUDING a list of securities: removes (i.e. subtracts) securities from a first security list if those securities are present in a second list and returns the reduced list
- PLUS a security: adds a single named security to a security list and returns the resulting list
- EXCLUDING a security: removes a single named security from a security list, if it is present in that list, and returns the resulting list
Important Tips
- It’s a good idea to build trading lists a step at a time by using the List Selector’s Selector Terms (the equivalent of Private Terms for List Selectors). These are defined in the Selector Terms area below the main list selection definition.
The first selector term should apply some simple filters to reduce the initial number of shares in the source list. The next term can then use that term as the source of its shares and apply a more complex set of selectors. This continues through each term until the desired list is achieved. The parent list selector definition can then use that final term as the source of a ranked list. This final step allows you to restrict the number of shares, if required, to the best shares at the top of the list, based on your ranking criteria (e.g. profitability, price trend growth, etc.).
This approach is demonstrated in the List Selector definitions used for the Value & Growth and Momentum strategies defined in the Example Trading Spec. It has a number of advantages:
- list selection is much faster by reducing the number of shares using simple selectors, before moving onto more complex selectors
- by using layered selector term definitions, it makes list selection easier to understand and manage. You can also create Indicator Overlays on each private term to get a feel for how much each term reduces the total number of shares in the final trading list.
- by using the final ranking in the parent list selector definition, you can control the number of shares selected. Keeping the number of shares down (i.e. ideally in the low 100s and below the memory saving thresholds defined in Resource Settings) greatly accelerates the execution of back-tests and Live sessions.
2. Remember that not all companies report all company results all of the time. If you are testing a result and it has not been reported by a company, then that company will be excluded from the trading list. You can get a feel for how much of an issue this might be by adding that result column to a ShareScope Share List window to see how many companies are missing that result. If it is an issue, then consider including an “…OR whose result name is not defined” in the private term selection condition, so the shares of companies without the result are still selected for the trading list. For an example, please see the ‘Manageable Debt‘ private term in both strategies’ list selectors in the Example Trading Spec.
3. Similarly, if you are comparing a result to a threshold, make sure you know what units ShareScope reports those results in and ensure the threshold is in the same units (e.g. Market Cap is reported in £millions, while price is in pence). Again, this can be done by checking the results in a Share List window.
4. To define a security list containing only a single security, first define it as an ’empty list’ then use the list operator ‘PLUS a security’ to add the required security to the list. For an example of this see the Example Trading Spec’s Shared Lists ‘Index‘ term. This is used to add the FTSE All-Share index to each strategy’s trading list. Doing this is useful, as it ensures that one, non-tradeable security is always selected, so its overlays are always updated. This ensures you have a full set of overlay data for the entirety of a back-test or a Live session. Please refer to the Graphical Overlays help topic for further information.
List Selector Restrictions
List selectors may have to deal with a very large number of shares in their source list. Because of this, the constructs available for list selector definitions have been slightly restricted, compared to term and trading rule definitions. These restrictions are as follows:
- Lists cannot be selected based on AutoTrend price-channel or trading-signal data, because neither of these data types are available at the time list selection occurs. Instead of channel data, consider using price trend data, available in a share’s ‘price statistic over a period’.
- Selector Terms can be defined for list selectors but, unlike their equivalent Private Terms, they may not contain price indicators.
- Constructs that require memory of values over time are not available in list selectors. This prevents the possibility of out of memory errors caused by the large number of shares in the source list. The affected constructs are:
Value Expressions Excluded From List Selectors:
- historical value expressions
- change in a value over a period
- value statistic over a period
- number of times a condition is
Condition Expressions Excluded From List Selectors:
- value has just crossed another value
- value has reached a top or bottom
- value for some periods is
- condition has transitioned
- historical condition was
4. List selectors definitions can reference selector terms, without restriction. However, they can only use constant (i.e. invariant) strategy or shared Named Terms. They cannot reference variable strategy or shared terms that depend on the variable output of an expression because it may not be possible to evaluate the components of those expressions at the time of list selection.