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

[amibroker] Re: One-step top10 complete application



PureBytes Links

Trading Reference Links

Perhaps some wrap mistake.
Copy the code from

http://groups.yahoo.com/group/amibroker/message/47293
expand mode.
It works.

// top10 Exploration and Application
function select( listnum )
{
list = GetCategorySymbols( categoryGroup, listnum );
Rank = 0; 
for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
{
C1 = Foreign( sym, "C" );
f=LastValue(RSIa(C1,14));
Rank[BarCount-1-i] = f[i];
}
return Rank ; 
}
No=254;// replace 254 with your GroupNo
R= Select(No);H0=Select(No);
L1=LastValue(Cum(1));
N=101;// the population of the database
TOP=10;// the topX calibration
for(K=1;K<=TOP;K++)
{
H1=LastValue(HHV(H0,n));
BAR1=LastValue((ValueWhen(H0==H1,Cum(1)-1)));H0[BAR1]=-10;
}
ORD=L1-Cum(1);
// The trading system
Buy=Cross(StochD(),30);
Sell=Cross(StochD(),70);
E=LastValue(Equity(1,0));
Filter=H0==-10 AND ORD==Status("STOCKNUM");
AddColumn(E,"E");
 

--- In amibroker@xxxxxxxxxxxxxxx, "sloughbridge" <sloughbridge@xxxx> 
wrote:
> --- In amibroker@xxxxxxxxxxxxxxx, "Dimitris Tsokakis" 
<TSOKAKIS@xxxx> 
> wrote:
> > // top10 Exploration and Application
> 
> Sorry, but I can't tell why I get this error msg:
> 
> Line 15, Column 14:
> return Rank ; 
> 
> }
> 
> No=254;// replace 254 with your GroupNo
> 
> R= Select(No);
> -------------^
> 
> Error 7.
> Subscript out of range
> 
> Any help?
> 
> Thanks!


------------------------ 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/