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

[amibroker] Re: simple(?) question



PureBytes Links

Trading Reference Links

Graham - in attempting to simplify my question, I left out the 
details of my code...sorry about that. Below is the full example. I 
have been trying to troubleshoot but am still missing something.

Thanks,
Tom
___________________________________________________________________

function Filter_List(Listnum)
{
dollarcheck = Null;
barcount_result = Null;
 
list1 = CategoryGetSymbols( categoryWatchlist, Listnum );
 
     for( m = 0; ( sym1 = StrExtract( list1, m ) ) != ""; m++ )
     {
        d = Foreign(sym1, "C");
	barcount_result = BarCount < 780 ;    
	TRACE("barcount_result = " + barcount_result +", symbol = "  
+ sym1 + ", barcount = " + BarCount); 
	dollarcheck = LLV(d,260) < 1.00; 
       _TRACE(" Low value for " + sym1 + " over the last 260 days 
is " + LLV(d,260));
	_TRACE("Dollarcheck = "  +  dollarcheck);    

            for( p = BarCount-1; p <= BarCount-260; p--)
		{
		if(dollarcheck[p] == 1) _TRACE(" symbol = " + sym1 
+ " is less than $1.00");
                 CategoryRemoveSymbol( "", categoryWatchlist, 0 );
                 }

		if(barcount_result){ _TRACE(" Symbol = " + Name() 
+ " has less than 780 trading days");
    		CategoryRemoveSymbol( "", categoryWatchlist, 0 );
                 } 
      }


--- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxx> wrote:
>
> do you not get an error message when you run this?
> firstly using IF with an array variable (which is what check is)
> requires a FOR loop to iterate through the bars, but I assume you 
only
> want to run on the alst bar, so you need to cahnge the array to a
> scalar value (single value for all bars)
> 
> 
> if(LastValue(check)) CategoryRemoveSymbol("",categoryWatchlist, 0);
> 
> --
> Cheers
> Graham
> AB-Write >< Professional AFL Writing Service
> Yes, I write AFL code to your requirements
> http://e-wire.net.au/~eb_kavan/ab_write.htm
> 
> 
> On 3/17/06, trb0428 <trbrowne@xxx> wrote:
> > Hi -
> >
> > I'm trying to check if any of my stocks have closed below 
price "x"
> > in the last "y" periods and take some action:
> >
> > I have:
> >
> > X = 1.00;
> > y = 260;
> >
> > check = LLV(C,y) < x;
> >
> > //Now I want to:
> >
> > if (check){ CategoryRemoveSymbol("",CategoryWatchlist, 0);
> >
> > This doesn't seem to be finding the stocks in my watchlist that 
are
> > less than 1.00... I am confident I am stepping throught the 
stocks
> > in the Watchlist correctly....anything obvious I have missed???
> >
> > Thanks,
> > Tom
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > 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
> >
> >
> >
> >
> >
> >
> >
> >
>







------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/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:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

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