scans

Tutorial - Scan Tutorial - Setting Data Columns

Let's looks at the following scan.....

SET(V#1, LRS) AND SET(V#2, CL-LO)

In this scan, we will be using the SET operator to set the values of the V#1 and V#2 custom data columns. Let's use a periodicity of Daily again for the scan, and choose an appropriate input quotepage on which to run the scan. The ".All Symbols" quotepage contains all the symbols defined in your system. If you are just getting started, you may want to select this one.

Tutorial - Creating Scans

scanWin

Important Note: This tutorial was originally developed for scans, before the language to write them was referred to as RTL. However, this tutorial will be equally useful in general as a tutorial on RTL for signals and custom indicators. The one difference with scans, is that they allow the user to supply a quotepage and a periodicity for the scan to run on. These items are not present in the signal and custom indicator windows. But the RTL logic applies equally to all three.

This Tutorial will be helpful in the following areas...

Tutorial - Compound Scan

Let's looks at the following compound scan.....

MACD1 <= 0 AND MACD > 0

In this scan, we introduce two new concepts: the compound scan, and the qualified scan token. We are going to run this scan on daily data to find MACD bullish crossovers. In other words, the MACD value for the previous day was less than or equal to zero, while the current day's MACD value is greater than zero.

Tutorial - Scans - Arithmetics in Scans

Let's looks at the following scan.....

(HI + LO + CL) / 3 > MA

In this scan, we will emphasize the importance of bracketing or parenthesizing when using arithmetic in scans. We will run the above scan on Daily data. As you can see from the expression above, this scan is taking the average of today's High, Low, and Closing prices and comparing that average with a moving average. The quotepage that results will consist of instruments whose current days average is greater than it's moving average.

Scans, Trading Signals, Custom Indicators Special Functions

Function Description Example
SQRT(X) Square Root of X SQRT(HI _ LO)
ABS(X) Absolute Value of X ABS(CL - CL1)
MIN(X,Y) Minimum Value of X during the preceding Y periods MIN(RSI, 5)
MAX(X,Y) Maximum Value of X during the preceding Y periods MAX((HI4 - LO), 8)
AVG(X,Y)

Operators - Arithmetic, Relational, Logical

Operators - Arithmetic, Relational, Logical

Arithmetic Description Example
+ Addition HI + LO + CL
- Subtraction MA - CL
* Multiplication (CL * 2 + MA * 3) / 5
/ Division (HI + LO + CL) / 3
% Remainder operator. X % Y results in the remainder of X / Y. For instance, 10%3 = 1.

Numeric Constants and Flags

Numeric constants and flags are simply tokens which represent constant numbers. They exist to facilitate equation composition. The descriptive tokens are generally easier to remember than the numbers they represent.

Pages