Searching for patterns:

Every time you run a command set automatically, FDC produces a playlist. This playlist contains the names of all datasets produced by lines in the command set, either displayed or hidden, and only those names.

Q. I want to search my datasets for a particular recent pattern, and list all of the dataset names for which the pattern occurs.

The first line resets the numbering of temporary dataset names. Later lines are indented for clarity. Indenting is not required.

The second line starts the loop, looking in turn at each dataset named in the list “demos” and for each one performing computations in the lines between :for and :endfor

As each dataset comes by, the third line checks it to see if a particular pattern is true - in this case if the 5-day change is greater than 0 (i.e. is the current close greater than the close 5 days pervious).  Of course the :if expects to see a true (1) or false(0), while the expression

(5 change cl #1) > 0

actually generates an entire dataset of trues and falses (a logical dataset). This is just for convenience. If you present an :if with a logical dataset, it will simply use the last (most recent) item. By using a macro in place of this simple test, you can use as complicated a test as you wish.

The fourth line tells FDC what to do if the pattern is true. In this case, add the name of each dataset for which the pattern occurs to the playlist. (The command set does not actually produce any dataset (displayed or hidden) so the playlist would be empty if you did not add the name.)

The fifth line ends the pattern search.

The sixth (final) line ends the loop.

Then go to the List Wizard   and  click on  .  You will be presented with a list of the names of datasets that passed the test. You can  , Edit, Sort or Save .

-------------------------------------------------------------------------

reset

:for #1 :in demos

     :if 0 lt 5 change cl #1

     list '#1'

     :endif

:endfor