Terry,

Thanks but this still doesn't work right. THe problem now 
is "barcount" is relative to the selected symbol (the one displaying 
the price chart) and not the FC array barcount as the "For loop" is 
iterated. Is there a way to change the symbol each pass through the 
loop to be the correct symbol?

Thanks

--- In [email protected], "Terry" <[EMAIL PROTECTED]> wrote:
>
> See red lines:
> 
>  
> 
> summing = 0;
> 
> list = CategoryGetSymbols( categoryIndustry, IndustryID(0) ); 
> 
>  
> 
> for( i = 0; ( symbol = StrExtract( list, i ) ) != ""; i++ )
> 
> {
> 
>     FC = Foreign( symbol, "C" );
> 
>     If (barCount > x) //Where x is the number of days history 
needed
> 
>     {
> 
>         VarSet("C"+i, MA(FC,50)); 
> 
>         VarSet("S"+i, IIf(FC > MA(FC,50),1,0)); 
> 
>         summing = summing + VarGet("S"+i);
> 
>         Plot(VarGet("C"+i),"C"+i,colorWhite,styleLine); 
> 
>     }
> 
> }
> 
> ratio = (summing / i) * 100;
> 
>  
> 
> Plot(ratio, "%stocks > 50 DMA", colorBrightGreen, styleLine |
> styleThick);
> 
>  
> 
> _N( Title = "# stocks = " + i + " # above 50DMA = " + summing  );
> 
>  
> 
> --
> 
> Terry
> 
>  
> 
> -----Original Message-----
> From: [email protected] [mailto:[EMAIL PROTECTED] 
On
> Behalf Of trb0428
> Sent: Tuesday, July 25, 2006 15:06
> To: [email protected]
> Subject: [amibroker] How to exclude symbols?
> 
>  
> 
> I am trying to create an indicator that will calculate the 
percentage 
> 
> of stocks within an industry that are trading above their 50 day 
> 
> moving average. 
> 
>  
> 
> My problem is if there is a stock in the list that has a short 
> 
> trading history, say only trading for 200 days, the entire 
indicator 
> 
> is limited by this short symbol. How can I exclude stocks that 
fail 
> 
> to meet a minimum number of bars in my formula below? I do not 
want 
> 
> to use ATC for this. Thanks.
> 
>  
> 
> -------------------------------------------------------------------
> 
>  
> 
> summing = 0;
> 
> list = CategoryGetSymbols( categoryIndustry, IndustryID(0) ); 
> 
>  
> 
> for( i = 0; ( symbol = StrExtract( list, i ) ) != ""; i++ )
> 
> {
> 
> FC = Foreign( symbol, "C" );
> 
> VarSet("C"+i, MA(FC,50)); 
> 
> VarSet("S"+i, IIf(FC > MA(FC,50),1,0)); 
> 
> summing = summing + VarGet("S"+i);
> 
> Plot(VarGet("C"+i),"C"+i,colorWhite,styleLine); 
> 
> }
> 
> ratio = (summing / i) * 100;
> 
>  
> 
> Plot(ratio, "%stocks > 50 DMA", colorBrightGreen, styleLine | 
> 
> styleThick);
> 
>  
> 
> _N( Title = "# stocks = " + i + " # above 50DMA = " + summing  );
> 
>  
> 
>  
> 
>  
> 
>  
> 
>  
> 
> 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 other support material please check also:
> 
> http://www.amibroker.com/support.html
> 
>  
> 
>  
> 
> Yahoo! Groups Links
> 
>  
> 
>     http://groups.yahoo.com/group/amibroker/
> 
>  
> 
>     [EMAIL PROTECTED]
> 
>  
> 
>     http://docs.yahoo.com/info/terms/
>






------------------------ Yahoo! Groups Sponsor --------------------~--> 
GFT Forex Trading Accounts As low as $250 with up to 400:1 Leverage. Free Demo.
http://us.click.yahoo.com/lpv1TA/jlQNAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to