Article Contents
Print

Security Expressions & Terms

Security Terms and expressions define a particular security. A security is the generic term that RuleTrader uses for all shares (associated with a company) and all non-shares, which it calls instruments (or just instruments for short, e.g. ForEx, market indices, sector indices, etc.).

Any construct that references a security’s value, characteristic or attribute will also require you to define the security whose data you want. This can be done by referencing a security term, or by defining the security within the construct, using any of the following security expressions.

Security Constructs

The expression constructs available for selecting a security are:

  • Evaluated security: Each day a back-test is run, and each time the Live session receives new data, RuleTrader cycles through every security in your Spec’s trading list, making each one the ‘evaluated security’. That security’s data (e.g. price, volume, company results, characteristics, attributes, or position, trade, or channel data, etc.) is then used to evaluate every Trading Rule and Named Term that uses or tests the ‘evaluated security’s data (which is usually most of them)
  • Evaluated security’s named security term: This is simply the security returned by a Security Term in your Spec, which is evaluated in the context of the currently evaluated security. This is only of relevance if the expression that selects the share or instrument is dependent on the ‘evaluated security’. In this case, it is this currently evaluated security that is used when evaluating the expression. Contrast this with Other security’s named security term, next
  • Other security’s named security term: This is the security returned by a Security Term that is evaluated in the context of some other security A, which is specified next in this construct. This means that if this Security Term expression is dependent on the ‘evaluated security’, then it is the security A that is used as the ‘evaluated security’, when evaluating the expression. If you’re interested, please see List Ordering Expressions & Evaluated Security Context for a more in-depth discussion of the evaluated security context.

This is very useful for pairs trading. For example, you can use one of ShareScope’s Note columns to list the MKT:EPIC code of shares that are paired with each share in a ShareScope list or portfolio. You can then use Security from a Note column (see below) to select one of those paired shares and then use Evaluated security’s named security term and Other security’s named security term to compare the values of the same term, when it is evaluated in the context of each paired security. Based on this comparison, you may then decide whether to trade one or other (or both) of the paired shares

  • Share’s sector index: returns the sector index instrument for the share that is specified next in this construct
  • Share’s market index: returns the market index for the share that is specified next in this definition. As a share may belong to more than one index, this construct requires you to specify a prioritised list of indices. The first market index instrument in the list, that matches one of the shares indices, is then returned
  • Security from a ShareScope list: picks a named share or non-share instrument from one of ShareScope’s built in security lists
  • Security from a Note column: returns a share or instrument whose MKT:EPIC code is listed in one of ShareScope’s Note columns. This is very useful for Pairs trading. You must have previously entered the MKT:EPIC code of each share or instrument A that you want to associate with another share or instrument B, in the Note column on the same line where share B is listed. For example, in the following list Frenkel Topping Group PLC (share B) is associated with AB Dynamics PLC (share A), whose MKT:EPIC code is LSE:ABDP, using ShareScope’s Note 6 column. The easiest way to get a share’s MKT:EPIC code is from ShareScope’s ‘Find a share’ dialog, which opens when you press the A key on your keyboard, after clicking on a ShareScope Share List window, so it has the focus. The codes are listed in the first column of the dialog.
You can associate shares for pairs trading using Note columns
  • Security at a list position: returns the security located at a particular position in a security list, after it has been sorted according to some criteria. For example, you could order the list by profit growth over the last 3 years, then select the security at the top of that list to get the security with the fastest growing profit out of some list of securities e.g. the securities in some market sector
  • Security from a choice of securities: returns a security from one of two or more security expressions, based on a set of selection conditions that select one of those expressions

Security Expression Operators

Because Security Terms return only a single security, it would make no sense for the above constructs to be combined into an expression. So, unlike values, conditions and security lists,  there is no such thing as a security operator.

Scroll to Top