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

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



PureBytes Links

Trading Reference Links

No, there is not any bag.
Since V is integer, when you use V field you will get integer 
accuracy in composite calculation. It is proper when you want 
variables with integer values, as to count stocks with some property 
[they will be 24 or 25, 24.38 has no meaning]
C is more accurate, giving at least two decimals. It is proper when 
you calculate variables which need this accuracy [A MeanStochD may be 
81.37 or 81.65 or 81.92 and the use of V would give only 81 and then 
82]
You may use C in all calculations, no matter if you need two decimals 
accuracy, no problem.
I use V for integer accuracy and C for two decimals.
[when we began using composite calculations, only V field was 
available, some old codes still have V field, there is no reason to 
change them since they give me exactly what I want]
--- In amibroker@xxxxxxxxxxxxxxx, uenal.mutlu@xxxx wrote:
> 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.

If there were some profitable stocks there would be at least one 
above the average. Are there profitable stocks in the system you 
tried ?

> Thanks, I've learned a new useful feature of AB.
> 
> UM
> 
> 
> ----- Original Message ----- 
> From: "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx>
> 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 ---------------------~-->
Get a FREE REFINANCE QUOTE - click here!
http://us.click.yahoo.com/2CXtTB/ca0FAA/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/