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

RE: [amibroker] can backtest code tell how many stocks it's running against?



PureBytes Links

Trading Reference Links

A code posted to count tickers in a watchlist

//Count tickers in watchlist function
//Anthony Faragasso
//July 4, 2003
//Single watchlist output
WatchlistNumber=0;//enter watchlist number
function CountTickersInWatchList( Listnum )
{
// retrive comma-separated list of symbols in watch list
list = GetCategorySymbols( categoryWatchlist, listnum );
for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
{
if( i == 0 ) i = 0;
else i = i ;
}
return i; 
}
Filter=1;
AddColumn(CountTickersInWatchList( WatchlistNumber),"",1);

Cheers,
Graham
http://groups.msn.com/ASXShareTrading
http://groups.msn.com/FMSAustralia


-----Original Message-----
From: Dave Merrill [mailto:dmerrill@xxxxxxx] 
Sent: Friday, 12 September 2003 11:25 AM
To: AmiBroker
Subject: [amibroker] can backtest code tell how many stocks it's running
against?


I have some backtest code that can be run in two ways:

1) against a single shortable security, in which case it goes both long and
short,
	or
2) against a watchlist containing a pair of non-shortable securities, one of
which has inverse beta (RYVYX and RYVNX typically). in this case, it goes
long on both, buying the inverse fund as the "short".


the internal logic of the code needs to know which mode it's in. I could use
a param statement, or make aminor change in the code, but I wonder if
there's another way.

specifically, is there any way for backtest code to find out any of the
following:

- how many stocks are in the total universe of stocks it's running against,
or at least if there's more than one

- if it's running against a single security or a watchlist

- anything about stocks included in the backtest besides the one currently
being processed


any ideas? did I say this in a way that makes sense?

Dave Merrill


------------------------ 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/l.m7sD/LIdGAA/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/ 


------------------------ 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/l.m7sD/LIdGAA/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/