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

Re: [amibroker] Re: EOD source



PureBytes Links

Trading Reference Links

--- In amibroker@xxxxxxxxxxxxxxx, "Anthony Faragasso" <ajf1111@xxxx>
wrote:
> //% of stocks Advancing
Hi Anthony,

I tried your code in AA and Indicator Builder and I can't get it to
work. How do I use or apply the code?

Thanks Anthony!

Brian


> 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" ) > MA(Foreign( sym, "c" ),200);//
Ref(Foreign( sym, "c" ),-1) ;
> 
> if( i == 0 ) Advancers = f;
> 
> else Advancers = Advancers + f;
> 
> }
> 
> return (Advancers / i)*100; // divide by number of components
> 
> }
> 
> /////////////////////////////////////////////////////////
> 
> //Function
> 
> //% of stocks Declining
> 
> function CreatePercentofStocksdeclining( listnum )
> 
> {
> 
> // retrive comma-separated list of symbols in watch list
> 
> list = GetCategorySymbols( categoryWatchlist, listnum );
> 
> decliners = 0;
> 
> for( j = 0; ( sym = StrExtract( list, j ) ) != ""; j++ )
> 
> {
> 
> g = Foreign( sym, "c" ) < MA(Foreign( sym, "c" ),200);//Ref(Foreign(
sym, "c" ),-1) ;
> 
> if( j == 0 ) decliners = g;
> 
> else decliners = decliners + g;
> 
> }
> 
> return (decliners / j)*100; // divide by number of components
> 
> }
> 
> Plot( CreatePercentofStocksAdvancing( Wlist ), "Watchlist
"+WriteVal(wlist,1)+"\n"+"% of Stocks Above",colorGreen,styleLine);
> 
> Plot( CreatePercentofStocksdeclining( Wlist ), "\n"+"% of Stocks
below",colorRed,styleLine );



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

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

<*> 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/