See Also:
Using Scans in Investor/RT
See Also:
Using Scans with T# Variables
Purpose: Set the highlight color
of every symbol in the quotepage to a specific color (light blue) and
highlight every other symbol...
!SET(COLOR, COLOR_LTBLUE)
AND SET(FLAG, FLAG_HILITE * ((2*(SEQ%2 = 1))-1))
Explanation: The
first part simply sets the highlight color of each symbol to the color
light blue. The COLOR token represents the symbols highlight
color, while the token COLOR_LTBLUE is just a constant that represents
the light blue color. A list of the color constants can be found
by selecting the "Numeric Constants and Flags" in the "Show All Tokens"
listbox in the Scan window. SET is preceded by an exclamation
point "!" so that there will be no resulting quotepage from the scan.
The exclamation point is the NOT operator in this context and reverses
the TRUE/FALSE nature of the expression that follows it. Since SET
always returns TRUE, the express !SET will always return FALSE and
therefore prevent any results from showing up in a resulting quotepage.
The second part of the expression simply turns on
highlighting for every other row (1, 3, 5, etc) while turning it off in
the others (2, 4, 6, etc). The SEQ token provides the sequence of
the symbol within the quotepage. The % operator is the remainder
operator, and in this context, returns the remainder of the division of
SEQ by 2 (which is always either 1 or 0). The expression looks
relatively complicated, but is basically designed to multiply
FLAG_HILITE by ether 1 or -1, thus either turning highlighting on or off
respectively (on for odd rows, off for even rows).
Purpose: Turn highlighting off...
!SET(FLAG, -FLAG_HILITE)
Explanation: By
placing the negative sign in front of the FLAG_HILITE token, the
highlighting flag is turned OFF. Without the negative sign,
highlighting would be turned on for each symbol. The highlight
settings for each symbol can be reviewed by right-clicking on any symbol
in a quotepage and choosing "Setup". Highlight options are in the
advanced area of the Instrument Setup window.
Purpose: Find stocks that just crossed
their moving average...
CL > MA AND CL.1 <= MA.1
Explanation: The
".1" is considered a qualifier (the period is optional) and is used to
access data from prior bars. CL.1 gets the closing price of the
previous bar. CL.5 would get the closing price 5 bars back, etc.
This signal essentially reads "the closing price of the current bars is
above the moving average, while the closing price of the previous bars
was below (or equal to) the moving average of the previous bars.
Purpose: Rank symbols in accordance with
a formula you set up . The rankings can be used in another scan or a
quotepage to find the best candidates for a trade...
SET(V#1,(LRS>0 ))
AND SET(V#2,(LAST<=LRF#1 ))
AND SET(V#3,(LAST<=LRF#2))
AND SET(V#4,(6*V#1+V#2+V#3))
Explanation: Each
expression in parentheses is a logical expression and thus has a value
of 1 if true and 0 if false. In this example we are looking for
stocks that have a positive slope for a linear regression line and the
last price has pulled back from the median line . LRF#1 is 1 standard
deviation below the median line of a linear regression channel LRF#2 is
2 standard deviations below the median line. But the most important
characteristic is the slope so that is given a multiplier of 6 . So the
maximum score earned (the value of V#4) could be 8 when the slope is
positive and the last price is more than 2 standard deviations below the
median line . Then we can run a scan for symbols with a value of V#4 of
7 or 8 and put them into a quotepage for further examination.
Purpose: Pick out the best 100
candidates from a large quotepage....
SEQ <= 100
Explanation: Prior
to using this scan you had another scan pick out a large number of
candidates for trades based on some loose criteria. But you only want to
consider the best 100 candidates possibly for symbol limit
considerations or available money to trade. To make this work you sort
the quotepage used as a source by whatever criteria is most important to
you such as largest gain for the month or highest volume divided by
average volume, or lowest differences from the 50 day price moving
average. SEQ is the number of rows down from the top of the quotepage.
So this method creates a new quotepage out of the top 100 rows of the
source quotepage.
Purpose: Sets the highlight color (that
is seen in quotepages) for each instrument based on a given condition
(in this case, whether or not the long term MA is above the short term
MA)....
SET(COLOR, (MA_LONG >
MA_SHORT)*COLOR_PINK
+ (MA_SHORT >= MA_LONG)*COLOR_LTBLUE)
Explanation: This
scan will the highlight COLOR of each symbol to either Pink (if MA_LONG
> MA_SHORT) or Light Blue (if MA_SHORT >= MA_LONG).
Purpose: Show when CCI is currently at
-100 or below, but was above 100 over the last 10 bars, and vice versa.
....
CCI <= -100 AND MAX(CCI, 10)
>= 100
Explanation: This
first expression "CCI <= -100" is pretty straightforward, telling us
that CCI is below -100 on current bar. The second expression "MAX(CCI,
10) >= 100" tells us that the highest CCI value over the past 10 bars
was above 100. ANDing the two together returns true ONLY if both
conditions/expressions are true. To find when CCI is currently at
or above 100 but was below -100 over past 10 bars:
CCI >= 100 AND MIN(CCI, 10)
<= -100
|