Gamestudio Links
Zorro Links
Newest Posts
Z9 getting Error 058
by k_ivan. 04/25/26 19:13
ZorroGPT
by TipmyPip. 04/25/26 16:09
Stooq now requires an API key
by jcl. 04/13/26 09:42
Strange "Alien" Skull created with >Knubber<
by NeoDumont. 04/10/26 18:58
400 free seamless texture pack downl. here !
by NeoDumont. 04/08/26 19:55
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (3run, 1 invisible), 3,648 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
valino, juergenwue, VladMak, Geir, ondrej
19209 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Portfolio Trading with Anti-Un Correlated Equity Curve Returns #444244
08/03/14 19:30
08/03/14 19:30
Joined: Nov 2013
Posts: 123
Mithrandir77 Offline OP
Member
Mithrandir77  Offline OP
Member

Joined: Nov 2013
Posts: 123
After googling a lot and reading many articles, (for reference the two ones I found most interesting:

http://www.tradingblox.com/forum/viewtopic.php?t=8342
http://www.elitetrader.com/vb/showthread.php?t=242751 )

I would like to discuss and possibly get answers or some guidance to the subject.

Part 1:
From what I understand of the first link, combining strategies whose equity curve RETURNS are anticorrelated or uncorrelated improves metrics like Sharpe Ratio and Drawdowns.

For calculating the equity curve value for an asset/algo combination in Zorro is very simple: EquityLong + EquityShort
-Is that right?-

So for deriving what in the first link is called the return on day j:

Quote:
Let E[j] be the total equity on day number j. Then the equity curve return on day number j, written R[j], is simply R[j] = ((E[j] / E[j-1]) - 1). As you can verify yourself by making a couple of plots, the E[j] series is not stationary but the R[j] series is stationary. So given equity curves A and B, first we calculate the returns series of A and the returns series of B, and then we calculate the correlation of (returns series A) to (returns series B).


In Zorro it would be a code like this inside the run function:
Code:
var eq = series(EquityLong + EquityShort)
var r = ( eq[0] / eq[1] ) - 1
var returns = series(r)



Is anything wrong in this part? Particularly with Montecarlo I am unsure whether EquityLong/EquityShort refers to the actual equity or to the equity at the 50% confidence level.

Part 2:
From what I understood of what jcl says in the second link and the discussion afterwards (yes, I have read all 17 pages crazy ) drawdowns can be reduced by anticorrelated equity curves (when some is in a drawdown the other not) but according to the first link equity curve values are not stationary (which from what I understand is a necessary condition to making forecast models but I don't know about it in extent) so is that a flaw or what jcl wants is not the same as in the first link?

Finally,

Part 3:
Is there any relationship with equity curve returns (or the equity curve) and prices of the asset you are trading?

I ask this because I have this 'hypothesis': If you trade a trend following system with assets whose prices are UNcorrelated, ie correlation near 0, then the resulting equity curves (equity curve returns?) will be anticorrelated

Here is why according to my reasoning: When one asset is trending, a signal (for simplicity sake let's ignore false signals when trending) is made and since then profit. The other asset since correlation is 0 should be ranging so no signal is made or a false signal is made in which case a drawdown would ocurr (negative profit). So, when one equity is in a 'drawup' the other one is in a drowdown, hence the anticorrelation.

Is this reasoning correct? I have also an 'hypothesis' for cycle (counter trend) trading which is trading cycles which are shifted in duration would give also anticorrelated equity curves. Consider two curves shifted 180 degrees, you sell at top and buy at low of each cycle of each curve. When a trade in one curve is open a trade in the other curve is closed and made profit so when one equity curve stays the same the other goes up. Again, anticorrelation between equity curves. Is this reasoning also correct?

Thanks beforehand for your help and comments!

Re: Portfolio Trading with Anti-Un Correlated Equity Curve Returns [Re: Mithrandir77] #444264
08/04/14 13:55
08/04/14 13:55
Joined: Jul 2000
Posts: 28,094
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,094
Frankfurt
The quoted statement is wrong. R[i] is normally not stationary. Still, combining uncorrelated or anticorrelated strategies indeed improves the Sharpe Ratio. But due to the nonstationarity of returns, their correlations are also nonstationary.

This should be kept in mind, as it is not always just a theoretical problem. In certain market situations previously uncorrelated returns suddenly become correlated. This effect often precedes a price shock or market crash. It can even be used as an early warning.

I think your reasoning in part 3 is not correct: When 2 assets are uncorrelated, the trending of one has no correlation to trending or ranging of the second. Therefore the returns are also uncorrelated, but not anticorrelated.

Two price curves that are shifted by 180 degrees, but otherwise identical, will with most strategies generate strongly correlated returns - when one wins a long trade, the other one wins short, and vice versa. By the way, you can test this easily for your strategy by reversing a price curve with the Detrend variable. An inverted price curve is equivalent to a 180 degrees shift.

Re: Portfolio Trading with Anti-Un Correlated Equity Curve Returns [Re: jcl] #444280
08/04/14 18:46
08/04/14 18:46
Joined: Nov 2013
Posts: 123
Mithrandir77 Offline OP
Member
Mithrandir77  Offline OP
Member

Joined: Nov 2013
Posts: 123
Originally Posted By: jcl

I think your reasoning in part 3 is not correct: When 2 assets are uncorrelated, the trending of one has no correlation to trending or ranging of the second. Therefore the returns are also uncorrelated, but not anticorrelated.

Ok, but look at this: If you consider trading signals like a boolean ie trade=1,not to trade=0 then -again set aside false signals when trending, so a trade (1) results in profit ie equity growth- when a market is trending then 1, when it is ranging then 0 and there would be a false signal and a drawdown.

So following the above mentioned and that when one is trending the other is ranging and viceversa you get a table of signals like this

signal1 signal2
1 0
0 1
1 0
0 1
1 0
0 1

And the correlation of the signals above (hence their equity curves) is -1

Originally Posted By: jcl

Two price curves that are shifted by 180 degrees, but otherwise identical, will with most strategies generate strongly correlated returns - when one wins a long trade, the other one wins short, and vice versa. By the way, you can test this easily for your strategy by reversing a price curve with the Detrend variable. An inverted price curve is equivalent to a 180 degrees shift.


My bad, you are right. I should have said two price curves shifted 90 degrees. In that case I am right am I?

Re: Portfolio Trading with Anti-Un Correlated Equity Curve Returns [Re: Mithrandir77] #444322
08/06/14 10:14
08/06/14 10:14
Joined: Jul 2000
Posts: 28,094
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,094
Frankfurt
You're right insofar that you can always artifically produce curves that have a correlation coefficient of zero, but will still produce correlated returns. A simple example would be two assets that alternate between 1 and -1 correlation. Those assets have in fact strong correlation, but in a way that Pearson's correlation coefficient gives a misleading result of zero.

With real assets and real algorithms however correlated prices normally also produce correlated returns, and vice versa.

Re: Portfolio Trading with Anti-Un Correlated Equity Curve Returns [Re: jcl] #444360
08/07/14 13:28
08/07/14 13:28
Joined: Nov 2013
Posts: 123
Mithrandir77 Offline OP
Member
Mithrandir77  Offline OP
Member

Joined: Nov 2013
Posts: 123
Thanks again for your explanation. But know I think this raises another question but I will carry on some tests before I ask.


Moderated by  Petra 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1