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

Re: [amibroker] Re: Indicator help...



PureBytes Links

Trading Reference Links

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

}

/////////////////////////////////////////////////////////

//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" ) < 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 ), "\n"+"% of Stocks

Advancing",colorGreen,STYLEHISTOGRAM );

Plot( CreatePercentofStocksdeclining( Wlist ), "\n"+"% of Stocks

declining",colorRED,STYLEHISTOGRAM );

----- Original Message -----
From: bruiserbbq
Sent: Tuesday, February 01, 2005 3:50 AM
Subject: [amibroker] Re: Indicator help...


Or Graham....click this link to see the indicator in action...
http://www.safehaven.com/article-2526.htm


Thanks again....Dumb O'l Bruiser!





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

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.1 - Release Date: 1/27/2005


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

No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.1 - Release Date: 1/27/2005