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

Re: [amibroker] Re: Backtesting a Score Based System in AB



PureBytes Links

Trading Reference Links

Hi DT,

is it a bug of AB that AddToComposite seems not be able 
to write to two fields (ie. C and V) of the same composite file 
during a scan if that file wasn't existing yet?  (That is: if the 
file already exists, then it works; but otherwise one needs 
a second scan run until both fields get written to the file).
IMHO very curious. Perhaps this is also the reason you 
used two different files in your code?

BTW, I did test the code below. It was hard to understand
due to my lacking of understanding of the AddToComposite
function, but I think I've got it now. As the name says it simply
adds (ie. cumulates) passed values into the given field.
In step 1 one needs to create a composite for a basket of stocks
over past data (I took 10/1/2001 to today) . The second step
is doing an exploration for the same basket of stocks for today
and hoping for signals (for testing reasons one also can take a past 
date range).
Using factor 1.0 did not find any stocks for tomorrow, so one has 
to wait for better days.

Thanks, I've learned a new useful feature of AB.

UM


----- Original Message ----- 
From: "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Thursday, April 10, 2003 9:26 PM
Subject: [amibroker] Re: Backtesting a Score Based System in AB


> Here is an interesting selection method :
> Run first the
> Buy=Cross(StochD(),35);
> Sell=Cross(65,StochD());// the trading rules
> e1=LastValue(Equity());
> e2=IIf(e1>10000,e1,0);
> AddToComposite(e2,"~e2","c");
> AddToComposite(e1>10000,"~profitables","v");
> Buy=0;
> for all stocks, n=1 last quotations.
> With the line
> e2=IIf(e1>10000,e1,0); you filter out loosing stocks and with
> AddToComposite(e1>10000,"~profitables","v"); you count the profitable 
> ones.
> Then select the top stocks with the exploration
> Buy=Cross(StochD(),35);
> Sell=Cross(65,StochD());
> e1=LastValue(Equity());
> e11=Foreign("~e2","c")/Foreign("~profitables","v");
> f=1;
> Filter=e1>f*e11;
> AddColumn(e1,"e1");
> AddColumn(e11,"e11");
> for all stocks, n=1 last quotations.
> In this exploration you ask, among the profitable stocks, these 
> equities above the average.
> Note1: If you see more than 10 stocks, increase f=1 to f=1.2 or f=1.5.
> Note 2 : If you still see more than 10 stocks, then you have a great 
> system and take action tomorrow morning
> without any further delay !!!
> DT
> 
> --- In amibroker@xxxxxxxxxxxxxxx, uenal.mutlu@xxxx wrote:
> > In a score based trading system each stock gets
> > some (weighted/normalized) scores assigned and 
> > all the scores of the underlying indicators and methods
> > are cumulated for each stock. From this list I would
> > like to take the first (or the first x) stocks for backtesting.
> > How could this be realized in an exploration or in the backtester?
> > One would need to filter and collect the stocks meeting
> > the underlying criteria and then would need to sort the 
> > table and pick item number(s) and assign them to the Buy array.
> > This would be very interessting for testing the performance
> > of such a system in ABs backtester. 
> > Can this be done in AB?
> > 
> > UM





------------------------ Yahoo! Groups Sponsor ---------------------~-->
Make Money Online Auctions! Make $500.00 or We Will Give You Thirty Dollars for Trying!
http://us.click.yahoo.com/yMx78A/fNtFAA/i5gGAA/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/