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

[amibroker] Re: Top 100 Backtest



PureBytes Links

Trading Reference Links


Hi Stephane,

This is fantastic!!!!

***THANKYOU***

I have been playing around with your code (you were kind to share) and
it seems to lockup when I have 1000 stocks in the watchlist. I ended
up stopping Amibroker. I think it is working OK but it just takes
ages! :)

I have a Pentium 4 - 3gHz - 512 ram.

I reduced the number of stocks down to 30 or so and I can see them
stepping through OK. I noticed that there are some stocks with no
value and checking them I see that they didn't trade on the bar I
picked to run the "Explore" on.

The only other thing I noticed was that there were missing rankings
ie: sorting the list by ranking I found that the highest was 1, then 2
but 3 was missing, next was 4 etc there were a few others missing in
the list of 30. I think it may be due to the stocks that didn't trade
on the bar, but I'm not 100% sure. Maybe it needs something to check
if the stock traded before it is ranked?

This post is getting really long so I deleted some off the bottom.

Regards, Ranga.


--- In amibroker@xxxxxxxxxxxxxxx, "s.carrasset" <s.carrasset@xxxx>
wrote:
> Hello, I have always many interest in ranking and stocks selection.
> I think you can add in watchlist 0 thousand stocks, and  get for
each 
> stock its monthly rank ( with full code below)
> so you can Buy =  conditions and (Monthly_rank < 101) ;
> I have tested the code in AA with status (stocknum) and it works.
> 
> stephane
> 
> listNum=0 ;//enter watchlist number
> list = GetCategorySymbols( categoryWatchlist, listnum );
> TimeFrameSet( inMonthly );
> for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
> {
> SetForeign(sym);
> VarSet("MyInd"+i,MFI(14));// Indicator
> /*
> VarSet stores the Value of MFI
> ticker 0 has its value of MFI stored in MyInd + 0
> ticker 1 has its value of MFI stored in MyInf + 1 ...
> */
> Rank =1;// Initialize the Rank
> 
> for( j = 0; ( item = StrExtract( list, j ) ) != ""; j++ )
> {
> SetForeign(item);
> VarSet("ThisInd"+j,MFI(14));//Indicator
> Rank=Rank + IIf( VarGet("MyInd"+i) < VarGet("ThisInd"+j),1,0);
> /*
> VarGet returns the value of VarSet
> Every value of MyInd + i is compared to every Value of ThisInd + j
> and the Rank in incremented of + 1 every time the Ind is < to
others.
> */
> RestorePriceArrays();// to get out the influence of SetForeign
> }
> VarSet("Rank"+i,Rank);
> }
> TimeFrameRestore();
> 
> Filter=1;//Status("lastbarinrange");
> Count=Status("stocknum");
> Var=IIf(InWatchList(0),VarGet("Rank"+ Count),Null);
> AddColumn(TimeFrameExpand(Var , inMonthly),"Monthly Rank");
> AddColumn(Var,"Daily Rank");
> //Plot(TimeFrameExpand(Var , inMonthly),"",2,1);





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.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:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

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