• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 11:14am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 11:14am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Simple Mean Reversion 599 replies

Pairs Trading: Reversion to the Mean 22 replies

Forward test of my new mean reversion strategy 11 replies

Question for synthetic and non-synthetic currency pairs 0 replies

Cointegration, Synthetic hedges, mean reversion in R, Tech Thread 0 replies

  • Trading Discussion
  • /
  • Reply to Thread
  • Subscribe
  • 91
Attachments: Synthetic hedges, cointegration, mean reversion and similar stuff
Exit Attachments
Tags: Synthetic hedges, cointegration, mean reversion and similar stuff
Cancel

Synthetic hedges, cointegration, mean reversion and similar stuff

  • Last Post
  •  
  • 1 1516Page 171819 21
  • 1 16Page 1718 21
  •  
  • Post #321
  • Quote
  • Edited 3:25pm Jul 5, 2011 3:06pm | Edited 3:25pm
  •  7bit
  • Joined Mar 2009 | Status: Member | 1,231 Posts
Quoting Profitiser
Disliked
Why is ADF test ( http://www.stat.ucl.ac.be/ISdidactiq.../adf.test.html )recommended here ?
Ignored
No, I meant *if* you choose to use ADF *then* I recommend using the one that is implemented in R (and not waste time interfacing with some VBA code) since an R session is already running and in R it would be just one or two lines of code.

This was not pro or contra any specific class of test. In fact I implemented no such test at all because (a) the whole thing was only a quick proof of concept and (b) I am sure all such tests would give horribly bad numbers and also would not show any more information than what is already clearly visible to the trained eye when looking at the plot.

I believe such tests are best used for applications where you want to programmatically scan through thousands or millions of combinations in an automated way to filter out the best few that are worth bothering a human being for a closer look.
 
 
  • Post #322
  • Quote
  • Jul 5, 2011 3:55pm Jul 5, 2011 3:55pm
  •  7bit
  • Joined Mar 2009 | Status: Member | 1,231 Posts
Quoting Profitiser
Disliked
"combined returns" axis in trend-o-mat. What does the sizing mean ?
Ignored
in Arb-O-Mat it is pips or price (0.0001 would be one pip) and the lot size you need to calculate your profit is base_units (use them like Oanda Units, 1 Lot = 100000 units).

In Trend-O-Mat I am not totally sure at the moment without looking at the code. The regression will always force the y-axis into to a fixed range and the lot sizes are adjusted to make this happen, It might also work like the Arb-O-Mat (with base_units and 0.0001y=1Pip) but I am not totally sure. Maybe with some brain acrobatics it would be possible to prove this or otherwise determine how the exact profit should be calculated.

I don't use and don't recommend Trend-o-mat myself, I believe its concept is dangerously flawed. I personally like the Arb-O-Mat much more.
 
 
  • Post #323
  • Quote
  • Jul 5, 2011 4:08pm Jul 5, 2011 4:08pm
  •  stevegee58
  • Joined Oct 2005 | Status: Pip Slappa Extrordinaire | 1,012 Posts
Quoting 7bit
Disliked
I don't use and don't recommend Trend-o-mat myself, I believe its concept is dangerously flawed. I personally like the Arb-O-Mat much more.
Ignored
I was looking at the code in Arbo and Trendo a week ago and was wondering what you were up to with Trendo. The two EAs are tantalizingly similar.

Anyway it's a very stimulating idea.
You are in a maze of twisty little passages, all alike.
 
 
  • Post #324
  • Quote
  • Jul 15, 2011 6:02am Jul 15, 2011 6:02am
  •  dptrader
  • | Joined Jan 2010 | Status: Member | 56 Posts
Guys, I have read all the thread, but I don't understand how to calculate the LOTSIZE.

I undertsand that we have to verify the cointegration of the basket, but how to calcolate the correct lotsize? is there a mathematical formula?

Thank you!
 
 
  • Post #325
  • Quote
  • Sep 4, 2011 4:11am Sep 4, 2011 4:11am
  •  fajst_k
  • | Joined Jun 2008 | Status: Member | 121 Posts
7bit,

I've seen you video (holy grail) and I have a feeling that you show there in sample curve fitting (repainting ??) performance. I'm right or wrong ??

Do you have any data from real out of sample performance ??

Instead of using linear regressors which for sure will cause overfitting did you consider using of more advanced functions for estimating coefficients like polynomial fits or Support Vector regressors which will guarantee non linerality.

Krzysztof
 
 
  • Post #326
  • Quote
  • Sep 4, 2011 7:08am Sep 4, 2011 7:08am
  •  7bit
  • Joined Mar 2009 | Status: Member | 1,231 Posts
Quoting fajst_k
Disliked
7bit,

I've seen you video (holy grail) and I have a feeling that you show there in sample curve fitting (repainting ??) performance. I'm right or wrong ??

Do you have any data from real out of sample performance ??
Ignored
The videos demonstrate the problem. The only noteworthy thing I have found so far is this (the examples on this website): http://sites.google.com/site/prof7bi...-mat-arb-o-mat

Everything after the red line is out-of-sample. The first plot is from last year, the second plot was made recently with the same data. It seems to work only on very long timeframes, every attempt to use trend-o-mat for intraday trading has failed so far. And when you move the "back" and "now" lines around on the daily chart you will notice that before 2008 it did *not* work so well on longer timeframes either. And I have no idea when this current trend will end.
 
 
  • Post #327
  • Quote
  • Sep 5, 2011 2:11am Sep 5, 2011 2:11am
  •  whitegoodman
  • | Joined Oct 2008 | Status: Member | 1,080 Posts
Quoting 7bit
Disliked
The videos demonstrate the problem. The only noteworthy thing I have found so far is this (the examples on this website): http://sites.google.com/site/prof7bi...-mat-arb-o-mat

Everything after the red line is out-of-sample. The first plot is from last year, the second plot was made recently with the same data. It seems to work only on very long timeframes, every attempt to use trend-o-mat for intraday trading has failed so far. And when you move the "back" and "now" lines around on the daily chart you will...
Ignored
for someone that hasnt done econometrics or heavy stats this is a very difficult thread to read,

i have a question, i have an mt4 broker with all the futures products plus the major US stocks (broco trader)... would it be difficult to implement these in a synthetic basket or is it strictly for the USD currencies? (for example a synthetic version of the dollar index vs the real DX; or DX and gold etc etc)
Grabbing the bull by the horns!
 
 
  • Post #328
  • Quote
  • Dec 21, 2011 4:17am Dec 21, 2011 4:17am
  •  fre1
  • | Joined Jun 2009 | Status: Member | 4 Posts
Hi 7-bit,

Compile the mqh file and have the errors on the pic
Attached Image (click to enlarge)
Click to Enlarge

Name: 1.JPG
Size: 112 KB
 
 
  • Post #329
  • Quote
  • Dec 21, 2011 2:09pm Dec 21, 2011 2:09pm
  •  7bit
  • Joined Mar 2009 | Status: Member | 1,231 Posts
Quoting fre1
Disliked
Hi 7-bit,

Compile the mqh file and have the errors on the pic
Ignored
I cannot see any errors in your screen shot. Where do you see errors?

Errors would have red icons next to them and compilation would not succeed. Also these warnings in your screen shot are written in plain english, so it should be obvious what they mean (pretty much nothing) and that they should simply be ignored. (Sorry, but this has been explained thousands of times in hundreds of different threads here already I believe).
 
 
  • Post #330
  • Quote
  • Dec 21, 2011 2:18pm Dec 21, 2011 2:18pm
  •  surfeur
  • | Joined Jan 2008 | Status: Member | 194 Posts
7bit,

You still trade in this way ? (synthetic hedge?)
 
 
  • Post #331
  • Quote
  • Dec 22, 2011 1:19am Dec 22, 2011 1:19am
  •  fre1
  • | Joined Jun 2009 | Status: Member | 4 Posts
7 bit,

You saying the the pic is not a problem for using the mqh?

Input the trendOmat on the chart and there are no indicator

Are the mqh suppose to use on the strategy tester? Have the problem below

2011.12.22 14:16:56 2011.12.22 08:16 arbomat EURUSD,M1: dll calls are not allowed; 'mt4R.dll'-'RDeinit'
2011.12.22 14:16:55 2011.12.09 15:05 arbomat EURUSD,M1: dll calls are not allowed; 'mt4R.dll'-'RGetDllVersion'
 
 
  • Post #332
  • Quote
  • Feb 4, 2012 3:37pm Feb 4, 2012 3:37pm
  •  justtrading
  • | Joined Jan 2012 | Status: Junior Member | 2 Posts
I attached the compiled EAs to the chart, EA does smile, but nothing happens at all ! ?

Whats wrong ? Is it because today is no forex trading ?
 
 
  • Post #333
  • Quote
  • Mar 11, 2012 7:49am Mar 11, 2012 7:49am
  •  beyon
  • | Joined Mar 2011 | Status: Member | 34 Posts
Hi all,

thanks for your work 7bit :-)

Regarding the entire trading approach, it seems to me that we have a net exposure of one or more currencies.
That is we don't have a perfect hedge and I wonder if this is really useful.
Say for example the net exposure in USD is 10 lots.
Therefore any news on the USD would yield a higher volatility in the basket/portfolio.
So I wonder if it is useful to restrict the coefficient regression to the US trading session.
In general it seems to me that it would be more useful obey the forex sessions, especially the European and US session when the majority of the pairs consists of pairs of Europe and US.

Maybe I will give this approach a try in the next couple of days and report any findings right here.

Happy pips,
Juergen
 
 
  • Post #334
  • Quote
  • Apr 15, 2012 8:06pm Apr 15, 2012 8:06pm
  •  Dirtybrown
  • Joined Mar 2008 | Status: Cointegrated Member | 621 Posts
so who else is still using the arbomat? I just got mine working, seeing tons of potential
Skype: heliosphan187
 
 
  • Post #335
  • Quote
  • Apr 17, 2012 8:03am Apr 17, 2012 8:03am
  •  Ultimate6
  • | Joined May 2010 | Status: Member | 1,017 Posts
Quoting Dirtybrown
Disliked
so who else is still using the arbomat? I just got mine working, seeing tons of potential
Ignored
I've been playing with this stuff a lot over the past month.
 
 
  • Post #336
  • Quote
  • Apr 20, 2012 7:00pm Apr 20, 2012 7:00pm
  •  Dirtybrown
  • Joined Mar 2008 | Status: Cointegrated Member | 621 Posts
What are your impressions so far? I've attached a couple of baskets i tried, this my first week. Not bad Id like to learn more about R

Quoting Ultimate6
Disliked
I've been playing with this stuff a lot over the past month.
Ignored
Attached File(s)
File Type: zip DetailedStatement.zip   8 KB | 462 downloads
Skype: heliosphan187
 
 
  • Post #337
  • Quote
  • Apr 20, 2012 8:17pm Apr 20, 2012 8:17pm
  •  Dirtybrown
  • Joined Mar 2008 | Status: Cointegrated Member | 621 Posts
man why the hell aren't there more people on this thread? It's really pretty easy to connect R to MT, R runs circles around MT in computability, yet the large majority of traders on this site mindlessly stick only to it forever, unaware that there are other programs much better for quantitative trading
Skype: heliosphan187
 
 
  • Post #338
  • Quote
  • Apr 21, 2012 5:51am Apr 21, 2012 5:51am
  •  Ultimate6
  • | Joined May 2010 | Status: Member | 1,017 Posts
Quoting Dirtybrown
Disliked
What are your impressions so far? I've attached a couple of baskets i tried, this my first week. Not bad Id like to learn more about R
Ignored
What I've done so far is to try gain a deeper understanding of the whole theory of statistical arb / synthetic hedging.

I've written a program in c#, still constant work in progress, that does the same thing as the mql code with R to be able to take the level of experimentation to the next level. I also use R via my program.

What I've done is built a database with historic data for 20 odd different pairs. I do cointegration testing on every permutation of possible combination of pairs to find which ones are best cointegrated and suited for the purpose of stat arb. I'm trying 3 pairs / 4 pairs.. up to 6 pairs now to see which combo's make the best baskets. Besides thousands of combinations I also want to see how many bars back is the best for each timeframe.

As of this yesterday I'm also running an ADF test on all the combinations, so I have a johansen test result (eigen value) and a ADF test result. I found that these two tests can be a bit contradictory, ADF test for stationary values says a basket of 6 pairs 99% stationary and johansen test says it's not so much.

I can execute the trades on MT4 via my app, but so far results aren't worthy of mention. I can say that M1,5,15 timeframes are no good for me at the moment. I would like to be able to make a way to actually backtest this.
 
 
  • Post #339
  • Quote
  • Apr 21, 2012 7:25am Apr 21, 2012 7:25am
  •  Dirtybrown
  • Joined Mar 2008 | Status: Cointegrated Member | 621 Posts
Wow well you have put quite a bit of research into it then, good idea to store everything in a database. since you're using c#, I assume sql server?


have you found anything on the relationship between usdcad and nzdusd? From what I've seen on the thread and some experiments i did last year, they make a great couple.
Skype: heliosphan187
 
 
  • Post #340
  • Quote
  • Apr 21, 2012 9:37am Apr 21, 2012 9:37am
  •  beyon
  • | Joined Mar 2011 | Status: Member | 34 Posts
I'm currently implementing a quite similar approach in JForex with Dukascopy and a R connection to Java.
My findings at today are as follows:

1) Don't integrate pairs with ultra-high correlation like say EURUSD/USDCHF. Any type of regression on one of these pairs will give a 1-1 regression. Thus the coefficients are almost the same and we really trade then EUR/CHF because we've cancelled the USD exposure out. This is useless since we pay the spread twice.

2) All combination of pairs will generate very similar spread plots for some basket group. I'm currently running some granger causality tests on those spreads to see if there might be a "frontrunning" basket for onther. So far, as expected, there results are not promising since the market is highly efficient.

3) The whole idea of closing a basket when its spread is back to 0 could be altered. To me the reverting to the mean is just a sign to close all losing positions. Then adding a very thight SL to each winning position has the advantage to grab more profits. My results are way better with this strategy, but needs more time to evaluate.

In general this type of trading is nothing new and all the big hedge funds are trying to find good mean reverting portfolios.
I think it all boils down to find a stable back-looking period which means that the fundamentals were stable since then.
I always recalibrate this period when a major regime switch - because of fundamentals - occured.
I trade this strategy a live, but until now not automated. I look at the baskets and open the positions manually, since I don't trust my programming right now.

For me, the most important reasons for trading this are:

1) Diversification
2) No indicators or rationality bias, just pure statistical math.
3) Can be automated

Cheers,
Juergen
 
 
  • Trading Discussion
  • /
  • Synthetic hedges, cointegration, mean reversion and similar stuff
  • Reply to Thread
    • 1 1516Page 171819 21
    • 1 16Page 1718 21
0 traders viewing now
  • More
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2023