PureBytes Links
Trading Reference Links
|
Hello,
I would like to know if the code below is correct .
the purpose is to create the average of top ranked tickers in a
given watchlist
Stephane
listNum=0 ;<FONT
color=#008000 size=1>//enter watchlist number
list = GetCategorySymbols<FONT
size=1>( categoryWatchlist, listnum );
Rank=0;
MyInd=CCIa<FONT
size=1>(C,14<FONT
size=1>);
for( i = <FONT color=#ff00ff
size=1>0; ( sym = <FONT color=#0000ff
size=1>StrExtract( list, i ) ) != <FONT color=#ff00ff
size=1>""; i++ )
{
Rank =<FONT
face="Courier New" size=1> Rank
+ IIf<FONT
size=1>(MyInd<=CCIa<FONT
size=1>(Foreign( sym,
"C", False ) ,
14),<FONT
color=#ff00ff size=1>1,<FONT color=#ff00ff
size=1>0);<FONT face="Courier New"
color=#0000ff size=1>
VarSet(<FONT face="Courier New"
color=#ff00ff size=1>"Ranked"<FONT face="Courier New"
size=1>+i,Rank);
}
average=0<FONT
face="Courier New" size=1>;
Top=5<FONT
face="Courier New" size=1>;
for( <FONT face="Courier New"
size=1>j = 0<FONT
size=1>; ( sym = StrExtract<FONT
size=1>( list, j ) )
!= ""; <FONT
face="Courier New" size=1>j++ )
{
average=IIf<FONT
face="Courier New" size=1>(<FONT face="Courier New" color=#0000ff
size=1>VarGet(<FONT
face="Courier New" color=#ff00ff size=1>"Ranked"<FONT face="Courier New"
size=1>+j)< Top ,<FONT color=#0000ff
size=1>CCIa(<FONT color=#0000ff
size=1>Foreign( sym, <FONT color=#ff00ff
size=1>"C", False ) , <FONT color=#ff00ff
size=1>14),0<FONT
size=1>) + average<FONT
size=1>;
}
Plot(<FONT face="Courier New"
size=1>average,<FONT color=#ff00ff
size=1>"",6<FONT
size=1>,1);
GraphXSpace=10<FONT
size=1>;
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Sponsor
ADVERTISEMENT
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 the Yahoo! Terms of Service.
|