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

[amibroker] Re: Real World Systems



PureBytes Links

Trading Reference Links

Fred's eloquent post drew me into this.  I hope that you don't mind.  
We are both on the FT-Talk board.  Also please forgive the length of 
this post - I thought that I'd throw a couple of things into one.  
Like all of you, my interest is primarily in trading systems that I 
can use.  I have been using AB for a while, but haven't posted.  I've 
developed some tools that it is probably time to post.

I agree with Fred.  Amibroker is missing a couple of pieces that the 
FT-Talk / Trade folks have had for a while and were the catalyst for 
many of the systems developed there.  The tools allowed the 
development of many innovative solutions.  

I thought I'd briefly mention two of them -

1. The FT world is very familiar with pair trading.  This is 
relatively easy to implement in AB.  If I get permission from Dave 
Serbin, I'll post a generalized pair trading system using his FUBAR 
market timing signal translated to AB.  One of my reasons for doing 
the port was to use AB's facilities to examine how optimized the 
parameters were.  This can be done in AB by using the Optimize 
feature to do a sensitivity analysis on the variables.  I consider it 
VERY useful.

2. As you probably know from Trade, almost all of the trading modules 
can be implemented with the ExprFamilyTrade block.  I am in the 
process of implementing this as a DLL in Amibroker.  (I first tried 
an easier way as a COM object, but ran into a roadblock).

I thought I'd briefly describe ExprFamilyTrade for the non-FT folks 
in order to elicit some suggestions.

In Trade, there is code that can be used to do calculations much as 
in Amibroker.  Trade has the concept of families, though, which can 
be operated on in one fell swoop.  This effectively extends array 
math (such as in AFL) to matrix math where the rows are the 
funds/stocks, and the columns are the daily quotes.

Indicators from these families, or results from trading the members 
individually, can be passed to the ExprFamilyTrade block mentioned 
above.  One way to think of this block in programming terms is as an 
object.  Various properties of the object are set, and then a trade 
method is executed based on those properties.  The highest ranked "N" 
members are then traded and the composition of this "set" or 
portfolio is allowed to change over time based on constraints.  
Properties of the ExprFamilyTrade include -

Family - the time varying ranking values for each member of the family
MMarket - Traded to based on a market timing signal.  May also be a 
short fund or position.
Positions - number of funds/stocks held at a given time
BuyMinRank - Minimum rank required to qualify for a buy
HoldMaxRank - Maximum rank allowed to hold.  When exceeded, the issue 
will be sold, and the highest rank issue greated than BuyMinRank will 
be bought
HoldMinDays - Minimum hold time
Signal - Market timing signal that caused switch to MMarket
StartDate -
StopDate -

There are some other parameters, but I'll skip them for the sake of 
brevity.  You might notice a couple that one would consider missing, 
and are needed -

StopLoss -
TrailingStop
Position - a committment percentage
Rebalance - when to rebalance the available equity among the holdings

As a final note to offer an example of the use of this, I'll mention 
an application developed by W. Gansz called RUTTRFAMSIG.  What Werner 
did was the following -

1. Trade each member of a family based on a set of MACD, Stoch, RSI 
parameters (RUTTR).  (In AB, this could be  tuned for each member.)

2. Track "productivity" of each member timed with that signal.  This 
was the annualized return while on a buy, 0 while on a sell.

3. The "on buy" productivity was essentially the rank of the 
members.  This was passed to an ExprFamilyTrade block which held "N" 
funds with the parameters detailed above set to certain values such 
as hold 5 issues for a 10 day minimum replacing each one as its rank 
fell below 10, and so on.

The main thing to recognize about such a process is that it is 
effectively "walk forward testing".  The historical productivity 
numbers are used to choose the issues to hold.  They are then held 
for a period of time, and that return constitues the portfolio 
return.  What makes this entire process work is that the time-varying 
ranking (productivity) is available to the trading module for all 
issues. (Memory is cheap, and processing power is reasonably 
plentiful).  This particular approach seems to yield some useful 
results with stock baskets.

Anyway, I've gone on for way TOO LONG.  My real purpose was to 
stimulate some ideas and to offer the thought that with trading 
tools, the innovative people on this board will probably come up with 
some systems that are very useful and that will amaze us all.

Bruce Robinson


> SIMPLE replacement for that.  Hardly the best system in the world 
but
> hardly the worst.
> 2.	The ranking of trading vehicles, whether they be stocks or 
MF's
> based on something like MAR i.e. CAR / MDD during the periods of 
time
> that your simple market timing system is on a buy or the inverse of 
that
> if you allow shorting as well.  This allows for the strongest 
trading
> vehicles to be taken advantage of during buy periods and the weakest
> ones to be taken advantage of during sell periods.
> 3.	The trading of or possibly even sub timing of those individual
> trading vehicles based on some shorter term buy / sell criteria.
> 
> The problem at the moment from an AB perspective is that I don't 
believe
> all the pieces are in place to write the code to do this sort of
> analysis.


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