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

[amibroker] Re: Pairs Trading (a definition for Dingo)



PureBytes Links

Trading Reference Links

Steve,

Regardless of the system one uses, if the goal is consistant 
percentage returns then IMHO the only way to achieve those is to 
develop, test and optimize shooting for those.  If one builds, tests 
and optimizes for consistant dollar returns that's exactly what one 
will realize in their real life trading.  How could one expect 
otherwise ?

--- In amibroker@xxxxxxxxxxxxxxx, "Steve Almond (F)" <steve@xxxx> 
wrote:
> Fred,
> 
> I'll have another go at presenting the opposite opinion about 
compounding when we run backtester.
> 1. If you think that you are "modelling" the future as closely as 
possible when you run the backtester on your system, then you should 
probably use compounding. As you say, that's the way most of us trade 
in real life. In your case with a system which returns over 100% per 
annum with 2 or 3% drawdown you can turn $100,000 into $102,000,000 
in 10 years. Problem, for me (I should be so lucky) is that in year 9 
you are plonking down $51,000,000 on your trade.
> 
> 2. If you think that you are trying to compare various systems to 
find the one that gives a nice consistent return year after year and 
trade after trade, then I think backtesting without compounding gives 
a fairer comparison. Of course, even using your system we only turn 
the initial $100,000 into a miserable $1,100,000 over the ten year 
period....
> 
> Look at the effect of a blockbuster final year in each case. Assume 
that 10th year is 1999 and your system returns 300% in that year. Now 
compounding gives us a final figure of $204,000,000 whilst the non-
compounding system only returns $1,300,000. Do you really want to 
include a year where you made a nice $153,000,000 profit in your 
future plans? Do you expect to replicate that?
> 
> Final thing is - I "know" I won't reproduce the gains in example 1 
but I might just manage to beat the gains in example 2 (IF I had your 
system....).
> 
> Steve
> 
> 
> 
>   ----- Original Message ----- 
>   From: Fred 
>   To: amibroker@xxxxxxxxxxxxxxx 
>   Sent: Friday, April 18, 2003 11:15 PM
>   Subject: [amibroker] Re: Pairs Trading (a definition for Dingo)
> 
> 
>   Chuck,
> 
>   Your "go" at it is clearly a better description then mine ... 
> 
>   I'm still waiting for your rebuke of my description of 
compounding 
>   whether it is in terms of scaling up bet size or increasing the 
>   number of securities potentially invested in to be virtually the 
same 
>   in terms of how that affects system design, testing and 
optimization 
>   in that ones aim is still to yield consistant returns and 
drawdowns 
>   on a percentage basis.
> 
>   --- In amibroker@xxxxxxxxxxxxxxx, "Chuck Rademacher" 
>   <chuck_rademacher@x> wrote:
>   > MessageI'll have a go at defining pairs trading for you.
>   > 
>   > To me, there are two different kinds of pairs trading 
(fundamental 
>   and
>   > technical).
>   > 
>   > Before I get into that, however, I'll start by telling you that 
>   pairs
>   > trading is NOTHING MORE than buying one stock and shorting 
another.
>   > Usually, the dollars invested would be the same for each stock.
>   > 
>   > Fundamental pairs trading would be based on YOUR INTERPRETATION 
of 
>   the
>   > fundamentals for those two companies.   If you spent the time 
to 
>   review the
>   > annual reports for Ford and General Motors, for instance, you 
might 
>   decide
>   > that FUNDAMENTALLY Ford should outperform General Motors over 
the 
>   next six
>   > months.  So, you would buy Ford and short General Motors.   
Your 
>   trade, in
>   > theory, should not be affected by any move in the entire market 
or 
>   even the
>   > automotive sector.   At the end of the six-month period you 
would 
>   liquidate
>   > both positions.
>   > 
>   > Technical pairs trading is a little more complex.   Again, you 
>   would be
>   > buying one stock and shorting another.   Most pairs traders 
might 
>   only trade
>   > a "pair" that were in the same sector, but that isn't 
necessarily a
>   > requirement.   The idea here is that you find two stocks whose 
>   average daily
>   > returns move very much in unison.  I won't get into the math 
for 
>   determining
>   > this, but I'm sure you get the picture.    Let's say that you 
>   discover that
>   > the daily returns for Ford and General Motors almost aways move 
>   together.
>   > You also observe that if the returns move apart.... they tend 
to 
>   come back
>   > together.    You also observe the maximum amount that they 
varied 
>   over some
>   > period of time.   When you see them move apart by that amount 
>   again, you
>   > simply short the one with the higher returns and buy the one 
with 
>   the lower
>   > returns.  Finally, you just wait for the returns to come back 
>   together and
>   > liquidate both positions.     Again, the theory is that any 
major 
>   move in
>   > the overall market has no effect on your net position.
>   > 
>   > I might add that many, if not most, of the professional fund 
>   managers using
>   > pairs trading haven't done very well over the last quarter, 
>   generating
>   > negative returns for their investors.    I've been pairs 
trading 
>   for two
>   > years, netting just over one percent per month for investors in 
that
>   > particular fund.    I can also tell you that, in my opinion, 
any 
>   attempt at
>   > fundamental pairs trading is doomed for failure.
>   >   -----Original Message-----
>   >   From: dingo [mailto:dingo@x...]
>   >   Sent: Friday, April 18, 2003 3:13 PM
>   >   To: amibroker@xxxxxxxxxxxxxxx
>   >   Subject: RE: [amibroker] Re: Dynamic Indicators Poll -- VOTE 
>   AGAIN, PLEASE
>   > 
>   > 
>   >   Could you define "pairs trading" please?
>   > 
>   >   Thx!
>   > 
>   >   d
>   >     -----Original Message-----
>   >     From: Fred [mailto:fctonetti@x...]
>   >     Sent: Friday, April 18, 2003 3:08 PM
>   >     To: amibroker@xxxxxxxxxxxxxxx
>   >     Subject: [amibroker] Re: Dynamic Indicators Poll -- VOTE 
AGAIN, 
>   PLEASE
>   > 
>   > 
>   >     Yes. I know. See my previous post, but for example I don't 
want 
>   to
>   >     have to write my own Stdev routine for variable periods 
where it
>   >     would require a For loop or a script to get it done.  As 
I've 
>   said
>   >     before, IMHO the best thing about AB today is it's speed 
and 
>   the LAST
>   >     thing I want to do is slow it down w/For loops if I don't 
have 
>   to.
>   >     The best thing about the future of AB is of course the 
support &
>   >     potential enhancements and I'll be happy to take the latter 
in
>   >     whatever order Tomasz thinks best with my own personal 
>   preference at
>   >     the moment being the fixing of position size transactions 
being
>   >     automatically limited to total available cash followed by 
some 
>   other
>   >     aspects of portfolio trading i.e. pairs and ranking etc.
>   > 
>   >     --- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" 
>   <TSOKAKIS@xxxx>
>   >     wrote:
>   >     > Fred,
>   >     > take a look at
>   >     >
>   >     > per=10+Cum(1)%20;//variable period from 10 to 29
>   >     > StochKa=MA(100*(C-LLV(L,per))/(HHV(H,per)-LLV(L,per)),3);
>   >     > StochDa=MA(MA(100*(C-LLV(L,per))/(HHV(H,per)-LLV
>   (L,per)),3),3);
>   >     > Plot(StochDa,"",1,1);Plot(StochD(),"",4,8);
>   >     >
>   >     > for example.
>   >     > DT
>   >     > --- In amibroker@xxxxxxxxxxxxxxx, "Fred" <fctonetti@xxxx> 
>   wrote:
>   >     > > Tomasz,
>   >     > >
>   >     > > I agree completely that these are two different 
areas ... 
>   to me
>   >     > they
>   >     > > are both important with (1) being higher priority then 
>   (2) ...
>   >     > >
>   >     > > With regards to (1) and more specifically those 
functions 
>   like
>   >     ATR
>   >     > > that require multiple arrays ... I understand and in 
the 
>   case of
>   >     > ATR
>   >     > > I'm not sure I care if this is even dealt with as again 
it's
>   >     simple
>   >     > > enough like my example w/MACD to create ones own ATR 
with a
>   >     Foreign
>   >     > > symbol using straight AFL.
>   >     > >
>   >     > > In the case of a stochastic though it's clearly valid to
>   >     calculate
>   >     > it
>   >     > > as
>   >     > >
>   >     > > 100 * (C - LLV(C, n)) / (HHV(C, n) - LLV(C, n))
>   >     > >
>   >     > > as opposed to using highs and lows.  However here again 
I'm 
>   not
>   >     > sure
>   >     > > I care as it's easy enough to do these in straight AFL 
with 
>   n
>   >     being
>   >     > > time variant since HHV and LLV are already have the 
>   capability of
>   >     > > being time variant.
>   >     > >
>   >     > >
>   >     > > --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko"
>   >     > <amibroker@xxxx>
>   >     > > wrote:
>   >     > > > Hello,
>   >     > > >
>   >     > > > As I mentioned in the other post of mine there are
>   >     > > > TWO INDEPENDENT areas:
>   >     > > >
>   >     > > > 1. Make input data array available for functions like 
RSI
>   >     > > > 2. Make second argument (period) accept array too 
>   (variable
>   >     > period).
>   >     > > >
>   >     > > > Somehow people mix those 2 areas.
>   >     > > >
>   >     > > > Fred speaks that he wants all functions to cover at 
least
>   >     > > > area (1).
>   >     > > >
>   >     > > > The posts of Mark refer to area (2).
>   >     > > >
>   >     > > > Let me show you example:
>   >     > > >
>   >     > > > RSI( period ) - this function has no input data array 
>   (uses
>   >     CLOSE
>   >     > > array
>   >     > > > indirectly) and accepts static period
>   >     > > >
>   >     > > > (1) RSIa( ARRAY, period ) - this function accepts 
input 
>   data
>   >     > array
>   >     > > but accepts
>   >     > > > only static period
>   >     > > >
>   >     > > > (2) RSIa( ARRAY, dynamic_period ) -  this function 
accepts
>   >     input
>   >     > > data array
>   >     > > > and accepts both static and dynamic_period.
>   >     > > > (NOTE: Current version of AB does NOT support this
>   >     RSIa 'flavour'
>   >     > > yet)
>   >     > > >
>   >     > > >
>   >     > > > As to (1): implementation of this is relatively easy.
>   >     > > > There is one caveat however: many analytical functions
>   >     > > > in fact use MORE than one input array. For example 
>   Stochastics
>   >     use
>   >     > > > Close, Open and High arrays as inputs.
>   >     > > > ATR too needs OHLC, not only close.
>   >     > > >
>   >     > > > As to (2): not every function is suitable for this 
kind of
>   >     > > operation. Although
>   >     > > > theoretically it is possible to rewrite every 
function to
>   >     accept
>   >     > > such 'variable
>   >     > > > periods' the practice shows that transformations that 
are
>   >     > recurrent
>   >     > > in nature
>   >     > > > (exponential averages for example) are 
>   extremely 'sensitive' if
>   >     > > parameter(s)
>   >     > > > change to fast. A kind of "frequency modulation" 
effect 
>   appears
>   >     > > that may produce
>   >     > > > distortions therefore one should be careful working 
with
>   >     adaptive
>   >     > > systems
>   >     > > > using recurrency-based transformations.
>   >     > > >
>   >     > > > Best regards,
>   >     > > > Tomasz Janeczko
>   >     > > > amibroker.com
>   >     > > > ----- Original Message -----
>   >     > > > From: <uenal.mutlu@xxxx>
>   >     > > > To: <amibroker@xxxxxxxxxxxxxxx>
>   >     > > > Sent: Friday, April 18, 2003 5:28 PM
>   >     > > > Subject: Re: [amibroker] Dynamic Indicators Poll -- 
VOTE 
>   AGAIN,
>   >     > > PLEASE
>   >     > > >
>   >     > > >
>   >     > > > > And IMHO also
>   >     > > > >   LINEARREG, LINREGSLOPE, TSF
>   >     > > > > should be removed from your list. Please
>   >     > > > > check the remaining too... Test it in AFL editor 
(it 
>   will
>   >     > inform
>   >     > > you
>   >     > > > > via a small hint window about the params after you 
type 
>   the
>   >     > > opening brace).
>   >     > > > > UM
>   >     > > > >
>   >     > > > > ----- Original Message -----
>   >     > > > > From: <uenal.mutlu@xxxx>
>   >     > > > > To: <amibroker@xxxxxxxxxxxxxxx>
>   >     > > > > Sent: Friday, April 18, 2003 5:21 PM
>   >     > > > > Subject: Re: [amibroker] Dynamic Indicators Poll -- 
VOTE
>   >     AGAIN,
>   >     > > PLEASE
>   >     > > > >
>   >     > > > >
>   >     > > > > > Hi mark,
>   >     > > > > > can you clarify BBANDBOT and BBANDTOP;
>   >     > > > > > IMHO they both already do accept user defined 
>   arguments
>   >     > > > > > for all the 3 possible parameters to them.
>   >     > > > > > UM
>   >     > > > > >
>   >     > > > > >
>   >     > > > > > ----- Original Message -----
>   >     > > > > > From: "markf2" <feierstein@xxxx>
>   >     > > > > > To: <amibroker@xxxxxxxxxxxxxxx>
>   >     > > > > > Sent: Friday, April 18, 2003 4:03 PM
>   >     > > > > > Subject: [amibroker] Dynamic Indicators Poll -- 
VOTE 
>   AGAIN,
>   >     > > PLEASE
>   >     > > > > >
>   >     > > > > >
>   >     > > > > > > In Message 38132, Tomasz pointed out that HHV, 
LLV,
>   >     > HHVBars,
>   >     > > LLVBars,
>   >     > > > > > > DEMA, TEMA, MA, WMA, REF, and SUM already work 
with
>   >     dynamic
>   >     > > > > > > parameters. When I updated the poll to reflect 
>   this, ALL
>   >     > > votes were
>   >     > > > > > > lost so please vote again if you're still 
>   interested, LOL.
>   >     > > > > > >
>   >     > > > > > > http://groups.yahoo.com/group/amibroker/surveys?
>   id=1071266
>   >     > > > > > >
>   >     > > > > > > I apologize for the confusion.  The fact that 
the 
>   above
>   >     > > indicators and
>   >     > > > > > > functions accept dynamic parameters was 
reflected in
>   >     > release
>   >     > > notes but
>   >     > > > > > > not in the 4.30 users guide that I used to make 
the
>   >     poll.
>   >     > > The fact
>   >     > > > > > > that so many of you voted for them shows you 
didn't 
>   know
>   >     > > either, and
>   >     > > > > > > I've asked Tomasz to include this information 
in 
>   the next
>   >     > > > > > > documentation update.
>   >     > > > > > >
>   >     > > > > > > Mark
>   >     > > > > > >
>   >     > > > > > > "No good deed goes unpunished."
>   >     > > > > > > --Steve Karnish
>   >     > > > >
>   >     > > > >
>   >     > > > >
>   >     > > > >
>   >     > > > > Send BUG REPORTS to bugs@xxxx
>   >     > > > > Send SUGGESTIONS to suggest@xxxx
>   >     > > > > -----------------------------------------
>   >     > > > > 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/
>   >     > > > >
>   >     > > > >
>   >     > > > >
>   > 
>   > 
>   > 
>   >     Send BUG REPORTS to bugs@xxxx
>   >     Send SUGGESTIONS to suggest@xxxx
>   >     -----------------------------------------
>   >     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 the Yahoo! Terms of 
>   Service.
>   > 
>   > 
>   >         Yahoo! Groups Sponsor
>   > 
>   > 
>   > 
>   >   Send BUG REPORTS to bugs@xxxx
>   >   Send SUGGESTIONS to suggest@xxxx
>   >   -----------------------------------------
>   >   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 the Yahoo! Terms of 
>   Service.
> 
> 
>         Yahoo! Groups Sponsor 
>        
>        
> 
>   Send BUG REPORTS to bugs@xxxx
>   Send SUGGESTIONS to suggest@xxxx
>   -----------------------------------------
>   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 the Yahoo! Terms of 
Service.


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