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

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



PureBytes Links

Trading Reference Links

Bruiser:

 

The change to make it show percentover30 is fairly easy to implement.

 

Here is a portion of the function that I altered:

 

function CreatePercentofStocksOver30( 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" ),30) ;

            if( i == 0 ) Advancers = f;

            else Advancers = Advancers + f;

      }

 

      return (Advancers / i)*100; // divide by number of components

 

Notice the f = Foreign( sym, "c" ) > MA(Foreign( sym, "c" ),30) ;

 

Just copy and rename a new function (say CreatePercentofStocksOver10) and then alter the statement for the correct MA.

 

My thanks to Anthony for sharing this code---I have never made or used a watchlist loop like this and this was easy to understand and easy to modify.

 

Ken

 

PS: in the Plot statement, rename the plotted function as:

Plot( CreatePercentofStocksOver30( Wlist ), "\n"+"% of Stocks Over Ma30",colorGreen,styleLine );

Comment out the next Plot statement.

 

It looks pretty much like what is in that page you shared (which BTW, had a lot of good stuff—too bad it is going subscription).

 

 

-----Original Message-----
From: bruiserbbq [mailto:bruiserbbq@xxxxxxxxxxxx]
Sent:
Tuesday, February 01, 2005 3:32 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: Indicator help...

 


Thanks Anthony, but not quite what I was after....have a look at this
link to see the indicator I speak of...

http://www.safehaven.com/article-2526.htm


Thanks again
Bruiser





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

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





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 incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.2 - Release Date: 1/28/2005


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