PureBytes Links
Trading Reference Links
|
In a previous post, I outlined some of the problems one has to take
into account when using AB to test a basket of stocks with a market
timing system. I look forward to the day when AB will have portfolio
level testing.
Here are some ways I can picture portfolio level testing being
implemented in AB. Give Tomasz's great ability, I am sure what he
finally produces will go far beyond what I outline.
BASIC PORTFOLIO TESTING:
The issue here is to make sure AB has a limit for either the number
of open trades it has (easy to implement) or the amount of capital
committed (easy to imagine but harder to implement). A "sort by"
function would need to be added to AB's AFL. AB would then use
the "sort by" code to create an array (ticker and sort value) of 50
stocks for each date/time bar. Of course, the stocks would be sorted
with in the array according to the sort by values.
Then on a second pass over the data, AB would take the top 10 or 20
stocks from the array for every entry signal date. If a stock gets
stopped out, AB would replace it using the sort by array for the
next trading day. (Of course, one would like to be able to turn this
replacement feature off for some strategies).
Summary resutlts could be similar to the current ones AB gives, with
a few additions. It would be nice to know what percentage of stocks
were winners for each trade period (again I am picturing market
timing systems).
PORTFOLIO TESTING LEVEL TWO
I would like to be able to test 2 or more portfolios at the same
time. Thanks to comments from a trader with a lot of experience, I
believe one can get a much smoother equity curve by using two or
more strategies at the same time. Although there are many
possibilities, let me share just one: would it not be nice to have a
trend following system and a system that does well in non-trending
markets. That way if one is getting whipsawed, the other would be
making money big time. I might be expecting too much (a very smooth
equity curve) for a modest cost (assuming the out of phase method
will not take too much of the profit fo the in phase method). But
the point is being able to test such ideas.
How could this be implemented? In very simple terms, AB would
generate 2 distinct arrays of stocks for each data day (one array
for each method). Then on the second pass, AB would uses these
arrays to trade 2 portfolios. There would need to be an additional
line of code to tell AB how often to reallocate capital between the
two strategies.
PORTFOLIO TESTING LEVEL THREE
For level two I picture testing two strategies that use the same
market timing signal. The next step of complexity would be to be
able to test 2 methods/portfolios when each has its own timing
method.
Since this is a wish list, I might as well add that it would be
great to be able to test more than 2 at the same time: perhaps 4 or
5. Also it would be nice to be able to specify different weightings
to the portfolios: For example, portfolio 1 gets 40% of capital,
portfolio 2 gets 30%, portfolio 3 gets 20% and portfolio 4 gets 10%.
WHAT DO OTHERS THINK? What would you like to see in the way of
portfolio testing?
b
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/
|