Lines 1, 3,4,5,6,7,11,13,14 are comments.
They are identified by exclamation marks.
EDS will not
process lines that start with an exclamation mark.
Line 2 is a rule. This line links
a true/false value and a date with the rule name
MyScan.
This line uses the scanany function to find the first occurrence, looking back
10 days,
for tickers that have a closing price equal to 40. It will also retain the date
of the first occurrence.
Line 6 is a UDF.
This line links the value of the difference of days between the date you ran the
report and date the rule MyScan was true to the udf name
Offset. It first resets the date with the Cut operator(^),
next it checks to make
sure the rule MyScan is true, then it returns
the difference of days between the date you ran the report and date the rule
MyScan was true.
Line 9 is a rule. This line links
a true/false value with the rule name Rule.
The date is reset with the Cut operator(^),
then if the rule MyScan if true and the value of
offset is greater than 4, Rule is true.
Line 10 is a UDF. This line links the value of
today's close with the udf name Close.
Line 12 is a UDF. This line links the value of
the close the day MyScan was true with the udf name CloseOnRule.
Since this line doesn't use the Cut operator(^)
CloseOnRule will return the value of the closing price on the day the rule MyScan
was true.
Line 14 is a UDF. This line links the value of
the close 4 days after the day MyScan was true with the udf name
Close4DaysLater. This line doesn't use the Cut operator(^)
because the date was already reset for Offset. This line uses ValResult instead
of Val to return the value of a UDF instead of a
field. Offset is subtracted by four to return
the value of the close 4 days after MyScan was true.