PureBytes Links
Trading Reference Links
|
Ed,
Try starting with this code and run it against the list of stocks you
want to count
// Calculate whether issue is above selected moving averages
Over50=(C>EMA(C,50)) ;
Over200=(C>EMA(C,200)) ;
// Create composites for moving average breadth for all issues
AddToComposite(Over50,"~MA050","X");
AddToComposite(Over200,~$MA200","X");
The code will create composites with daily counts of all the stocks scanned.
Regards,
Ed
Ed wrote:
>I'm hoping someone can help me out by suggesting some AFL code. I
>want to analyze sectors by numbers of stocks within specific sectors
>that are above or below their 20 day MA over a number of periods.
>Gathering numbers manually is time consuming for all the sectors, so
>I'm wondering if there is code that I can add on to the following:
>
>Filter=C>MA(C,20);
>
>NumColumns = X;
>
>Column0 = Date1;
>Column1 = Date2;
>Column2 = Date3;
>Column3 = Date4;
>Column4 = Date5;
>Column5 = Date6;
>Column6 = Date7;
>Column7 = Date8;
>Column8 = Date9;
>....
>
>Column0Name = "Date1";
>Column1Name = "Date2";
>Column2Name = "Date3";
>Column3Name = "Date4";
>Column4Name = "Date5";
>Column5Name = "Date6";
>Column6Name = "Date7";
>Column7Name = "Date8";
>Column8Name = "Date9";
>....
>
>Column0Format = 1.1;
>Column1Format = 1.1;
>Column2Format = 1.1;
>Column3Format = 1.1;
>Column4Format = 1.1;
>Column5Format = 1.1;
>Column6Format = 1.1;
>Column7Format = 1.1;
>Column8Format = 1.1;
>
>I'm missing more of the filter and other code that I'm at a loss
>with. I dont have any specific time periods in mind, but I would
>like to be able to modify them. Thank you!
>
>
>
>
>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
>
>
>
>
>
>
>
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/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/
|