testing Tutorial - RTL

What follows is a basic tutorial on RTL. The tutorial will focus primarily on RTL syntax and how to write formulas.

The Basics

RTL is written using Tokens to access data elements. Some simple Token examples are:

  • CL (Closing Price of a Bar)
  • OP (Opening Price of a Bar)
  • HI (High Price of a Bar)
  • LO (Low Price of a Bar)
  • VO (Volume of a Bar)
  • MPD (an indicator token, the Mixed Periodicity Data indicator)
  • MA (in indicator token, the moving average indicator).

Tokens can be followed with a period and a number to reference the value some number of bars back. For example, CL is  the close of the present bar, while CL.5 is the close of the bar 5 bars back. The token HI.1 is the previous bar high. The expression HI.2 - LO.2 is the high/low range 2 bars  earlier. MA > MA.1 is a true/false expression, true when the present value of the moving average is higher than the moving average was yesterday.

Tokens are combined in the RTL Editor Window to build expressions. Let's begin by opening the RTL Editor Window by going to File → New → RTL Object or use the Windows shortcut ALT-R or macOS shortcut command-R.

RTL Editor

  1. Chooses the Type of RTL Object you'd like to Create or Open. Use the dropdown to view existing RTL objects of the "Type" chosen.
  2. Favorites Button. When pressed, refines the list of tokens to show only your favorites as defined in Setup → Configuration → RTLFavoriteTokens. Add your own personal semicolon separated list of Favorites to this Configuration Variable to see them appear in the RTL Editor Window (i.e. CL;MPD;MA;).
  3. Lists the available Tokens along with a dropdown at the top to Filter by certain types of Tokens. For a more detailed description of each Token, see the Tokens Tab on this page.
  4. Lists the Tokens being used in the current RTL Object.
  5. Lists Function Tokens (more on Function Tokens later).
  6. Shortcuts to insert operators available in the RTL Language.
  7. Syntax Window to build your RTL expressions.
  8. Check your expressions for errors or Export a definition of the current RTL Object to share with other users.
  9. Save your work or use the "Send To" button to use the RTL Expression in a Chart or QuotePage.
Create your first RTL Object

First, open a chart by going to File → New → Chart. Then let's open the RTL Editor and choose Custom Indicator from available radio buttons(1) at the top of the RTL Editor window. In the syntax Window(5), type the token CL. Then press "Save As" and name this Technical Indicator "Closing_Price." Next, press Send To → Chart-Custom Indicator. You have just built your first RTL Object.

To edit the Indicator, double click on it in the chart. This will open the Custom Indicator Preferences Window which will allow you to change various aspects of the Indicators display.