[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Is it possible to code a save to a watchlist from Analysis explore?



PureBytes Links

Trading Reference Links

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


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

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/