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

[amibroker] Re: Looping Through Tickers in a Watchlist



PureBytes Links

Trading Reference Links

Joe
what I think you are after is 
if(Status("stocknum")==0)
{ your code }
This will only excute "your code" for the first ticker in the 
watchlist.  But if I understand what your trying to do correctly, 
you are using AddToComposite to save your average array, 
Unfortunately I don't think you can do this in one run, ie the 
AddTocomposite values are not available for the remainder of the 
portfolio trading routine, on this initial run. It is available to 
subsequent runs.  You could do what you want using the the table 
functions of the Osaka plugin.  Instead of writing to 
AddToComposite, save the array to a table and retrieve the array for 
each ticker.
Hope this is of some help
Andrew
--- In amibroker@xxxxxxxxxxxxxxx, "Joseph Landry" <jelandry@xxxx> 
wrote:
> I'm using a routine that calculates a family average from a 
> watchlist by looping through the tickers in the list and develops 
> an 'average' array. 
> 
> Once done and written to a composite, I'd like to skip this 
> computation stage for the rest of the portfolio trading routine. 
> No sense cycling through this especially if you're doing a 
portfolio 
> optimization. 
> 
> In other words, I'd like to call and execute the function 
once,when 
> I first enter the main AFL routine and then skip it for the rest 
of 
> the cycles and computation that AB applies in portfolio trading or 
> optimization, since I've got my average. 
> 
> I understood that there was an obscure test that you could apply 
to 
> test for the first pass through. Searching the web and my storage 
of 
> code routines and fragments I was not able to come up with it.
> 
> Any help would be appreciated.
> JOE


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

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