SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Strategies & Market Trends : TA-Quotes Plus

 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext  
To: Boom Dog who wrote (7779)11/12/1998 5:48:00 PM
From: Bob Jagow  Read Replies (1) of 11149
 
No auto/global vars -- all are reinit at each symbol.
foo := bar is Pascal, C uses foo = bar].
Most everything is documented in Help -- use index or find. -Bob
Help var
---
The QuotesPlus Scan Database Program lets you declare variables to store values. There are 3 types of variables that you can declare:

Integer can contain only an integer (whole number) value
float can contain a number with decimal places
String can contain an alphanumeric value

You can declare multiple variables of a single type by separating the variables by commas. Variable names can consist of up to 82 letters or decimal digits and must begin with a letter. To assign a variable, use the ":=" operator.

Example 1:
This example shows how to declare 2 integers and 1 float variable to calculate the average daily volume over the past 2 days.

// Declare two integer variables
Integer I,J;
// Declare a float variable
Float F;
if Close(0) > 30 then
//Assign today's volume to the variable I
I := Vol(0);
//Assign yesterday's volume to the variable J
J := Vol(-1);
//Calculate the Average Volume and assign to F
F := (I + J) / 2.0;
Println Symbol , " Average Vol = " , F ;
endif;

Example 2:

Float f;
Exchange Nyse;
f := EMovAvg(0,40,cl);
If f > 45.0 and f < 55.0 and f > Close(0) then
println symbol;
endif;

This example declares a variable named f and stores the exponential moving average of the close in it. We can then use this vaiable to select only stocks that have an exponential moving average of the close between 45 and 55 and greater than the current close.

Example 3:
You can also declare a String variable to be used in creating custom output files. A string variable contains text characters (including spaces and numbers to be treated as text).

· When you assign a value to a string variable, put the value in quotes.

· You can use the @ operator to concatenate (join) strings, as in the example below.

· You may not use the names Symbol, Description, or CUSIP for string variables; these names are reserved by .

Output = "Report.txt";
String str;
//Declares a String variable named str
str := "The selected stock is ";
//Assigns text to the variable
str := str @ Symbol;
//Uses the "@" operator to join the issue symbol to the string.
Exchange NYSE ;
If Close(0) > 80.0 and HasOptions = True then
Println str, Date(0);
endif;

Example Output:

The selected stock is AIG 06/05/1996
The selected stock is AMR 06/05/1996
The selected stock is ARC 06/05/1996
Report TOU ViolationShare This Post
 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext