|
Bob,
I think alias is only for AmiQuote, but I'm not positive this is it's only use.
I multiple databases and solved this problem (for 4 main Indexes) as follows. You can adapt for your symbols. Possibly you will want to mark your symbols as Indexes or use a certain Group or Category so it doesn't have to search 100's or 1000's of symbols to find the right ones.
PS: I made this an include file so I can re-use it in multiple AFLs.
//TH_Tickers.afl ---------------------------------------- //Finds tickers for the 4 main indexes
/****************** Auto-locate tickers for COMP, NDX, RUT, SPX *******************/
EnableTextOutput(False); //Don't print the following to the Interpretation window
COMP = NDX = SPX = RUT = SPC = "N/A"; //Need SPC since SPC comes before SPX alphabetically it will be found first. Save it and keep looking for SPX. Test at the end.
list = CategoryGetSymbols(categoryIndex,0); //Get a list of Symbols marked as INDEX for (i = 0; (tempName = StrExtract(list,i)) != ""; i++) //Search up to 15 Index symbols. Priority: $SPX > ^SPX > *SPC and $RUT > ^RUT { if((StrFind(tempName,"COMP") OR StrFind(tempName,"comp")) AND NOT StrFind(tempName,"COMPZ")) COMP = tempName; if((StrFind(tempName,"IXIC") OR StrFind(tempName,"ixic")) AND COMP == "N/A") COMP = tempName;
if(StrFind(tempName,"$NDX") OR StrFind(tempName,"$ndx")) NDX = tempName; if((StrFind(tempName,"^NDX") OR StrFind(tempName,"^ndx")) AND NDX == "N/A") NDX = tempName; if((StrFind(tempName,"NDX") OR StrFind(tempName,"ndx")) AND NDX == "N/A") NDX = tempName; //Finds other variations such as .NDX or NDX-I-5491
if(StrFind(tempName,"$RUT") OR StrFind(tempName,"$rut")) RUT = tempName; if((StrFind(tempName,"^RUT") OR StrFind(tempName,"^rut")) AND RUT == "N/A") RUT = tempName; if((StrFind(tempName,"RUT") OR StrFind(tempName,"rut")) AND RUT == "N/A") RUT = tempName; //Now accept ANY RUT ticker such as .RUT
if(StrFind(tempName,"$SPX") OR StrFind(tempName,"$spx")) SPX = tempName; if((StrFind(tempName,"^SPX") OR StrFind(tempName,"^spx")) AND SPX == "N/A") SPX = tempName; if((StrFind(tempName,"SPX") OR StrFind(tempName,"spx")) AND NOT StrFind(tempName,"SPXZ") AND SPX == "N/A") SPX = tempName; if((StrFind(tempName,"SPC") OR StrFind(tempName,"spc")) AND SPC == "N/A") SPC = tempName; //Will find ^GSPC (correct) and SPCA-I-6747 (wrong) }
if (SPX == "N/A" AND SPC != "N/A") SPX = SPC; //Found an SPC, but no SPX so we can use it. EnableTextOutput(True);
//Display what symbols are being used in the Interpretation Window. "\n-------------------------"; if (COMP == "N/A") printf("COMP symbol not found\n"); printf("Using " + COMP + "\n"); if (NDX == "N/A") printf("NDX symbol not found\n"); printf("Using " + NDX + "\n"); if (RUT == "N/A") printf("RUT symbol not found\n"); else printf("Using " + RUT + "\n"); if (SPX == "N/A") printf("S&P symbol not found\n"); printf("Using " + SPX + "\n"); "-------------------------\n"; //END -- Terry
-----Original Message-----
I've developed formulas for McClellan Osc, Summation, A/D, etc for indexes in FastTrack. Can I use the alias feature to make these formulas work whenI switch to QuotesPlus for indexes in the QuotesPlus data base?
For example if FastTrack symbol for Nasdaq Adv Vol is UVOLQ, the equivalent for Quotes Plus is !NQ-AV. So if I coded the formula for UVOLQ, can I use the alias feature in the QuotesPlus database by going to the !NQ-AV ticker and editing the alias field adding UVOLQ?
I've tried this with no sucess. How does the alias field work?
Bob K.
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/
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
|
- [amibroker] Use of Alias for Formulas for 2 databases Bob Krishfield
- RE: [amibroker] Use of Alias for Formulas for 2 datab... Terry
