Hello everyone,

I am opening this thread to throw a few ideas I have into the forum and see if we can "make them fly"!

For those who haven't seen my posts, here is a potted background of who I am and why I am here....

I have been trading for around 25 years and never bothered with public forums until a month or so ago someone pointed out the Abbonacci thread here on FF. I was somewhat intrigued and thought I would take a look. Sadly, I soon detected the unmistakeable whiff of Snake Oil and I decided to move on with my own ideas.

CanuckCT and several other experienced traders picked up on these ideas and CanuckCT kindly opened a thread to promote my system. This has gone very well, he and Squalou have written some excellent indicators and we are now on the verge of opening a chat room so we can take trades in real time together...

http://www.forexfactory.com/showthread.php?t=258762

While chatting to CanuckCT, he pointed me in the direction of "The Beast", an ingenious trading system based on Macman's Sixths indicator and coded into an EA by Steve Hopwood. Macman was interested in ways to optimise the system and I posted a few ideas in the original thread...

http://www.forexfactory.com/showthread.php?t=259284

Macman's approach was to diversify across a wide range of pairs so that hopefully when one pair is in DD, another is in profit. "TB" had a very good first couple of weeks and someone even mentioned the "G" word. (Like superstitious actors who only refer to a certain Shakespeare play as "

The obvious next step was then taken by someone who introduced the idea of using TB on a Basket of pairs. However, Steve rather took exception to this and abandoned the thread on the grounds that it had been hijacked by "

He opened a new thread on the original idea...

http://www.forexfactory.com/showthread.php?t=263253

However, in the last week or so, The Beast has bitten back!! Huge gains have turned into massive drawdowns and the punters are unhappy! It does appear, though, that Steve has had second thoughts about the basket idea as he has now opened several new thread on just this very topic...

While all this fun and games has been going on, I have been pottering away thinking about what started out as "the optimisation problem" but turned into a whole new philosophy (for me, at least). What I want to post here initially, is my first response to the vexed question of how to "tame The Beast".

(Interestingly, 7bit opened a thread recently on very similar lines while I was working on this...

http://www.forexfactory.com/showthread.php?t=262827

That is very comforting as it helps to reassure me that I am not completely crazy and that other minds are turning in a similar direction....)

The basket idea is very attractive, but the limitation of all the current ideas from T101 through to the recent Phantom 6 method, is that

It is perfectly possible to calculate the weights of each pair to create a perfect hedge. It would be rather pointless, of course, as the basket would never move -- see the first chart below. This shows 3 pairs (EU x UC vs EC) with weights 0.717, 1.033 and -0.741 respectively, and as you can see, with the exception of the odd spike, the basket hardly ever moves outside the sum of the spreads. This is precisely as we would expect, otherwise arbitrage opportunities would arise that the Big Boys' computers would jump on in microseconds!

So in order for the basket to move enough to be tradeable, the weights must be

But what is this basket?? All we really have here is just another synthetic currency that is just as prone to ranging, trending, whipsawing

What I really want is to make the market

So... this lead me to what Blackadder calls a "cunning plan". In fact, this one is so low and cunning you could put legs on it and call it a weasel!

What happens of we do the

The result is shown below in the second picture. Here, I have used some linear algebra to compute a least-mean-squared fit of the pairs to a horizontal line. Because the basket is not hedged, obviously the fit cannot be perfect. But the magic occurs when we find set of weights such that the basket is cointegrated.

I don't want to go deeply into this topic as it is very technical (see the two easy-to-read papers attached). All I ask is that no-one on this thread mention the dreaded "C" word.

Now I am home and dry, because it means that the basket has some temporal stability.

In similar, vein, I can demand a basket that is

So... if you have a killer system for trading ranging markets but which slays your account during trends (like TB), just trade the ranging basket. If you have a ripper trend trading system but which falls flat during ranging, trade the trending basket. We know with a high degree of statistical probability that the basket will not wander outside the bounds we have set.

Those who know about this stuff will immediately recognise this as

I have tried this both on demo and live and am very encouraged by the results. I am currently implementing the entire Stat Arb engine in MT4, see final picture.

I want to keep the thread free from "How do I load an indy" type newb questions, so am limiting the posters to 2+v. I hope that is OK. I may lift this restriction in future.

Also, I don't intend to post all my code as it is the result of many years of work (the linear algebra library is a thing of joy and beauty!). If you want to implement this stuff, please do a bit of homework and do it for yourself. The idea alone is enough to get you started.

Thanks and best regards,

Old Dog

I am opening this thread to throw a few ideas I have into the forum and see if we can "make them fly"!

For those who haven't seen my posts, here is a potted background of who I am and why I am here....

**Potted History**I have been trading for around 25 years and never bothered with public forums until a month or so ago someone pointed out the Abbonacci thread here on FF. I was somewhat intrigued and thought I would take a look. Sadly, I soon detected the unmistakeable whiff of Snake Oil and I decided to move on with my own ideas.

CanuckCT and several other experienced traders picked up on these ideas and CanuckCT kindly opened a thread to promote my system. This has gone very well, he and Squalou have written some excellent indicators and we are now on the verge of opening a chat room so we can take trades in real time together...

http://www.forexfactory.com/showthread.php?t=258762

While chatting to CanuckCT, he pointed me in the direction of "The Beast", an ingenious trading system based on Macman's Sixths indicator and coded into an EA by Steve Hopwood. Macman was interested in ways to optimise the system and I posted a few ideas in the original thread...

http://www.forexfactory.com/showthread.php?t=259284

Macman's approach was to diversify across a wide range of pairs so that hopefully when one pair is in DD, another is in profit. "TB" had a very good first couple of weeks and someone even mentioned the "G" word. (Like superstitious actors who only refer to a certain Shakespeare play as "

*The Scottish Play*", I have been in the game too long to use the "G" word - I only refer to the "*Cup of the Last Supper*").The obvious next step was then taken by someone who introduced the idea of using TB on a Basket of pairs. However, Steve rather took exception to this and abandoned the thread on the grounds that it had been hijacked by "

*...all sorts of weirdness...*".He opened a new thread on the original idea...

http://www.forexfactory.com/showthread.php?t=263253

However, in the last week or so, The Beast has bitten back!! Huge gains have turned into massive drawdowns and the punters are unhappy! It does appear, though, that Steve has had second thoughts about the basket idea as he has now opened several new thread on just this very topic...

While all this fun and games has been going on, I have been pottering away thinking about what started out as "the optimisation problem" but turned into a whole new philosophy (for me, at least). What I want to post here initially, is my first response to the vexed question of how to "tame The Beast".

(Interestingly, 7bit opened a thread recently on very similar lines while I was working on this...

http://www.forexfactory.com/showthread.php?t=262827

That is very comforting as it helps to reassure me that I am not completely crazy and that other minds are turning in a similar direction....)

**Taming The Beast**The basket idea is very attractive, but the limitation of all the current ideas from T101 through to the recent Phantom 6 method, is that

*. This is, of course, necessary for the systems to work as all the schemes use hedge-able baskets where the base and quote currencies "cancel out" (like cancelling fractions when multiplied).***the pairs in the basket are traded with equal lots**It is perfectly possible to calculate the weights of each pair to create a perfect hedge. It would be rather pointless, of course, as the basket would never move -- see the first chart below. This shows 3 pairs (EU x UC vs EC) with weights 0.717, 1.033 and -0.741 respectively, and as you can see, with the exception of the odd spike, the basket hardly ever moves outside the sum of the spreads. This is precisely as we would expect, otherwise arbitrage opportunities would arise that the Big Boys' computers would jump on in microseconds!

So in order for the basket to move enough to be tradeable, the weights must be

*those of the perfect hedge ratio, and equal weights is as good as any.***anything but**But what is this basket?? All we really have here is just another synthetic currency that is just as prone to ranging, trending, whipsawing

*etc etc*as any real pair. So what have we gained?*Answer*:**Nothing!!**What I really want is to make the market

*, not what it wants...***do what I want****The Cunning Plan**So... this lead me to what Blackadder calls a "cunning plan". In fact, this one is so low and cunning you could put legs on it and call it a weasel!

What happens of we do the

*of the above? Instead of taking a hedged basket of pairs and trading them in weights that are not the perfect hedge ratio,***exact opposite***?***what happens if we take a basket of pairs that do not form a hedge but demand a set of weights that makes them as close to a hedge as possible**The result is shown below in the second picture. Here, I have used some linear algebra to compute a least-mean-squared fit of the pairs to a horizontal line. Because the basket is not hedged, obviously the fit cannot be perfect. But the magic occurs when we find set of weights such that the basket is cointegrated.

I don't want to go deeply into this topic as it is very technical (see the two easy-to-read papers attached). All I ask is that no-one on this thread mention the dreaded "C" word.

*Cointegration is applicable. What I am calculating is a weighed sum of non-stationary series that yields a series that IS stationary.***Correlation is inapplicable to financial time series as they are not stationary!!**Now I am home and dry, because it means that the basket has some temporal stability.

*OK, they might not remain cointegrated for ever, but we can recompute and retest as often as we like and tweak the lot sizes as appropriate.***Some of the baskets I have found have had stable kernels for several years!**In similar, vein, I can demand a basket that is

*!! Why would I do this? So I can create a synthetic currency that***maximally non-stationary***- see the third picture below.***generally trends**So... if you have a killer system for trading ranging markets but which slays your account during trends (like TB), just trade the ranging basket. If you have a ripper trend trading system but which falls flat during ranging, trade the trending basket. We know with a high degree of statistical probability that the basket will not wander outside the bounds we have set.

Those who know about this stuff will immediately recognise this as

**Statistical Arbitrage**(Stat Arb) which is the game the Big Boys play. While we must never forget the lesson of LTCM, I believe that if carefully handled, we should be "cautiously optimistic" about this idea.I have tried this both on demo and live and am very encouraged by the results. I am currently implementing the entire Stat Arb engine in MT4, see final picture.

**Note on the thread**I want to keep the thread free from "How do I load an indy" type newb questions, so am limiting the posters to 2+v. I hope that is OK. I may lift this restriction in future.

Also, I don't intend to post all my code as it is the result of many years of work (the linear algebra library is a thing of joy and beauty!). If you want to implement this stuff, please do a bit of homework and do it for yourself. The idea alone is enough to get you started.

**EDIT**: 7bit has just posted some useful code in "R" if you want to have a play. I don't use it myself (never heard of it!!!). I just DDE export from MT4 to Matlab. The regression/cointegration is just 2 lines of code in Matlab. Then DDE back to MT4.Thanks and best regards,

Old Dog

Attached Files

Drunk-Dog.pdf 259 KB | 1,489 download

Drunk-Dog-Boyfriend.pdf 336 KB | 1,091 download