Here is another method that I picked up from NW Trader, Graham, and a
few others.  This example is code that searches for a minimum % change
from the prior day close (leaving out the displaying of the results).

//  --------  Parameter Variables for Exploration 
--------------------------------
WLF = ParamToggle ( "Add Results to a Watchlist?", "No | Yes")
;                               // select whether to add results to watchlist 
or not
WLN = Param("Set Watchlist Number", 13, 10, 64, 1);                             
                                // sets
the watchlist number
HCV = Param("High close value ", 300, 5, 300, 0.5);                             
                                        // sets
the high close value
LCV     = Param("Low close value " , 5, 1, 10, 0.25);                           
                                   // sets
the low close value
VP = Param("Period for Avg Vol " , 50, 10, 240, 1);                             
                                   // sets
the period for the average volume calculation
MAV = Param("Stock minimum Avg Vol " , 250000, 5000, 1000000,
5000);                     // sets the minimum average volume required
MC = Param("Minimum Change from Yesterday ", 3, 0, 100, 1);          
        // Input minimum change from yesterday's close

// ----- Initialization of parameters
PCY = ( (C-Ref(C,-1)) / Ref(C,-1) )*100;                             
        // adds a column for the close as a % from the prior close


// --------------------- Filter Section
My_Conditions = Close <= HCV AND Close >= LCV AND MA( Volume, VP )
>= MAV ;                // collects the basic variables in one statement
Filter = My_Conditions AND PCY >= MC;                                           
                                //
collects the conditions that will be filtered for
Buy = Filter;                                                                   
                                                                                
        // added so this will run as a scan
as well as an exploration

// ---------------------- Watchlist Section
Add = IIf( WLF==1 , Filter , 0 ) ;                                              
                                                                // checks to 
see if
results should go to a watchlist
if( LastValue( Add ) )                                          
{  CategoryAddSymbol( "", categoryWatchlist, WLN ); }                           
                                // sends
results to selected watchlist #


Hopefully you will be able to copy the text above into the formula
editor and get it to work.  Keep in mind that the defaults for each
parameter can be changed.  If you want to test this code change the
watchlist # to one that is available or is blank.

Regards,
MM

Reply via email to