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

[amibroker] Re: Running scans just to count conditions



PureBytes Links

Trading Reference Links

Hi Anthony, 

Thanks for posting this example code.  I will try to get to it as soon
as possible and will let you know how it turns out.

I guess it is time to roll up my sleeves and learn the Add To
Composite feature.

Dave

--- In amibroker@xxxxxxxxxxxxxxx, "Anthony Faragasso" <ajf1111@xxx> wrote:
>
> Here is something I have used....was written awhile back.....
> 
> //Function
> 
> //% of stocks Advancing
> 
> Wlist=Param("WatchListNum",0,0,63,1);
> 
> function CreatePercentofStocksAdvancing( listnum )
> 
> {
> 
> // retrive comma-separated list of symbols in watch list
> 
> list = GetCategorySymbols( categoryWatchlist, listnum );
> 
> Advancers = 0; // just in case there are no watch list members
> 
> for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
> 
> {
> 
> f = Foreign( sym, "c" ) > Ref(Foreign( sym, "c" ),-1) ;
> 
> if( i == 0 ) Advancers = f;
> 
> else Advancers = Advancers + f;
> 
> }
> 
> return (Advancers / i)*100; // divide by number of components
> 
> }
> 
> Plot( CreatePercentofStocksAdvancing( Wlist ), "% of Stocks
Advancing", colorGreen );
> 
> 
> 
> Anthony
> 
>   ----- Original Message ----- 
>   From: Phsst 
>   To: amibroker@xxxxxxxxxxxxxxx 
>   Sent: Friday, January 04, 2008 9:59 PM
>   Subject: [amibroker] Re: Running scans just to count conditions
> 
> 
> 
>   > How about using AddtoComposite function?
> 
>   That has always been TJ's position.
> 
>   But from my perspective, using ATC for simple "Counting" functionality
>   when I want to do quick counts of various conditions that exist within
>   a Watchlist or Group is usually more trouble or effort that I am
>   willing make where ATC's are concerned. 
> 
>   Why not simply add a new variable type that is initialized with each
>   execution of an Explore and then 'persists' throughout the execution
>   of the entire Explore so that you can display the various Counts of
>   whatever you want without having to use the more complex Composite
route?
> 
>   Maybe there is something too complex about establishing a new variable
>   type of this nature in AB that I don't comprehend... and then
maybe not.
> 
> 
> 
>    
> 
> 
>
------------------------------------------------------------------------------
> 
> 
>   No virus found in this incoming message.
>   Checked by AVG Free Edition. 
>   Version: 7.5.516 / Virus Database: 269.17.13/1209 - Release Date:
1/4/2008 12:05 PM
>




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/