| New signals service! | |
|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack (1) | Thread Tools | Display Modes |
|
|||
|
Simba,
I'm 100% on board. just a note - let's not confuse Autocorrelation and Hurst exponent: autocorrelation measure k-th order dependence in timeseries and was originally constructed for measuring dependence in error-terms/residuals of regression analysis (see heteroskedacity/homoskedacity), while Hurst exponent is a way more complex tool: Hurst exponent is estimated, not calculated: there are several ways to do it: Rescaled range analysis, Power-spectral analysis, Roughness length, Variogram and Wavelet transform. I think step 1 is autocorrelation: I've done it in Matlab: autocorr command but there doesn't seem to be a custom indicator that measures it, altough it doesn't seem to hard to do. Benoit – Fractal Analysis Software is software for estimating Hurst exponent, Interaction between MetaTrader 4 and Matlab via CSV Files - MQL4 Articles is the description for linking Matlab & MetaTrader. But if you get me the template (hopefully different from the mq4 file on TASC 03/07 Fractal Dimension Index) then I'll see what I can do: I'm committed to this. cheers. |
|
||||
|
Quote:
Thanks for the explanation. Unfortunately that was the file I was mentioning,the fractal dimension index. I will post in a few hours a file from WEALTHLAB that I believe does a good estimation of H,see if you can somehow translate the concept into mql4....and,I will check the links you provided ![]() Regards Simba
__________________
Somos mortales hasta el primer beso..y la segunda copa de vino
|
|
|||
|
ok, great.
The more I read about autocorrelation (parametric/nonparametric) the more I'm starting to think that it is really usefull, but what we need is maybe a little less complex: the ideal timeseries for trading would have very clear trends; and what is a trend? higher highs and higher lows or lower highs and lower lows, so based on closing prices we could just calculate a sort of "trend score" of a rolling window (the length of the window is hard to define) where every close of a bar "in the same direction" gets a +1 score, and where a close in a different direction gets a -1 score and you start at zero at the beginning of the window. I know this sounds a lot like other trend-indicators but it's really raw, so easier to manipulate. I'm reading more on nonparametric (no assumptions about probability distributions etc.) autocorrelation tests and I'll get back to you soon. Looking forward to that Wealthlab code though ![]() |
|
||||
|
Quote:
Hi, Here it is..and check this link too Traders Tips - May 2003 { Declare Variables } var E, Hurst, Bar, Period, SumDiff, FDIPane, EPane: integer; var R, S, H: float; Period := 200; { Create Custom Indicator Series } Hurst := CreateSeries; E := CreateSeries; { Our "E" Series is P/P[-1] } for Bar := 1 to BarCount - 1 do @E[Bar] := PriceClose( Bar ) / PriceClose( Bar - 1 ); { Calculate the sum of deviations over the period } SumDiff := SumSeries( SubtractSeries( E, SMASeries( E, Period ) ), Period ); { Plot deviation range } EPane := CreatePane( 50, true, true ); HidePaneLines; PlotSeries( HighestSeries( SumDiff, Period ), EPane, 474, #Thick ); PlotSeries( LowestSeries( SumDiff, Period ), EPane, 744, #Thick ); PlotSeries( SumDiff, EPane, #Silver, #Thick ); DrawLabel( 'Cumulative Deviation, and Range', EPane ); { Calculate R/S and the Hurst Exponent } for Bar := Period * 2 to BarCount - 1 do begin R := Highest( Bar, SumDiff, Period ) - Lowest( Bar, SumDiff, Period ); S := StdDev( Bar, E, Period ); @Hurst[Bar] := LN( R / S ) / LN( Period ); end; { Plot Hurst Exponent } FDIPane := CreatePane( 100, true, true ); PlotSeries( Hurst, FDIPane, #Navy, #Thick ); H := @Hurst[BarCount - 1]; DrawLabel( 'Hurst Exponent = ' + FormatFloat( '#0.000', H ), FDIPane ); DrawLabel( 'Random Walk = 0.500', FDIPane ); AddScanColumnStr( 'Hurst', FormatFloat( '#0.0000', @Hurst[BarCount - 1] ) ); Regards Simba
__________________
Somos mortales hasta el primer beso..y la segunda copa de vino
|
|
|||
|
another Fractal Dimension definition
This is one of the ways (Waveforms) of calculating Fractal Dimension in Matlab: it's the code of an M file. Remember: H = 2 - D
{_FractalDim Calculate the approximate Fractal Dimension of a waveform Copyright (c) 2003 by Alex Matulich, Unicorn Research Corporation January 2006: changed to calculate on n intervals rather than n-1. Note: the Hurst exponent H = 2 - D, where D is the fractal dimension. See the following article (particularly equation 6): A procedure to Estimate the Fractal Dimension of Waveforms Cevcik, Carlos, "A procedure to Estimate the Fractal Dimension of Waveforms," International Complexity, Vol 5, 1998. Because the lookback length n goes from 0 to n, we also have n intervals, and not n-1 intervals as described in the paper. } Inputs: y(NumericSeries), {price data, e.g. Close of data1} n(NumericSimple); {lookback length} Vars: j(0), lngth(0), ymax(0), ymin(0), yscl(0), dx2(0), dy(0); ymin = Lowest(y, n); ymax = Highest(y, n); yscl = ymax - ymin; if n < 2 Or ymax = ymin then lngth = 1 else begin { calculate length of curve } lngth = 0; dx2 = Square(1/n); for j = 1 To n begin dy = (y[j] - y[j-1]) / yscl; lngth = lngth + SquareRoot(dx2 + dy*dy); end; end; _FractalDim = 1 + (Log(lngth) + Log(2)) / Log(2*n); {Note: for large n, the result above converges to: _FractalDim = 1 + Log(lngth) / Log(2*n); However, because we typically using small values of n (like n<50) for market analysis, we use the result with the Log(2) term in it. See the technical article referenced in the opening comments.} More can be found on Matlab's file exchange: The MathWorks - MATLAB Central - File Exchange Another potentially usefull link is 2 archives in C where H is calculated in 2 different ways: the popular R/S & also the wavelet transform: Estimating the Hurst Exponent So would anyone be interested in taking a look at those two C archives and creating a custom indicator for Hurst exponent in those 2 ways? I'm afraid I'm not a programmer.. Last edited by MrM; 12-11-2007 at 12:44 PM. |
|
|||
|
Well no, because the theory around Hurst exponents is still developping, most papers speak of an estimation of H, and not a calculation: comparison between different calculation methods doesn't seem correct, but comparisons of Hurst exponents of different timeseries which were calculated with the same method seem to be a very valid tool.
Would you care to share your results? |
|
|||
|
Quote:
Why do I think this? It's against all the books and everything! It's quite simple actually. If discipline and few indicators would be enough, there would be millions of EAs that would provide constant profits (well all of them probably!). EAs don't have problem with discipline, they are most disciplined than you can ever be. Therefore problem with discipline is removed from the problem when you have EA's. And still nobody makes money with EA that only has couple of MA's and MACD. Edit: uh and sorry for making out of topic replies.. I'll try a little bit on the subject too (a bit only) :-) Stephen Wolfram has written a book "new kind of sciece" where he goes through his ideas on how to predict chaos or generate very complex structures that cannot be predicted by normal means easily (like liquid movements etc) with cellular automata, ie. small programs that act with each other. I haven't read the book very thoughly (it has been on my bookself for couple of years and it's THICK!) but I think there might be a point in his comments that you can emulate or predict some models with many small simple programs that communicate together. Stephen Wolfram: A New Kind of Science Forex would be a very good target for this kind of experiment because there are so many actors that it's probably impossible to find a common indicator for all the different scenarios, every scenario is a complex mixture of different aspects and outside influences. What I'm talking is a bit like neural network without the normal neuron connection, more like a neural network where each node is a specialized unit. And yes, I know wolframs theories are quite contoversial but there is some good points behind them too. Last edited by mikkom; 12-21-2007 at 07:29 AM. |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/analytics/11151-ideal-timeseries-trade.html
|
||||
| Posted By | For | Type | Date | |
| analytics/: Blogs, Photos, Videos and more on Technorati | This thread | Refback | 12-08-2007 09:59 PM | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ideal stop loss & take profit on each trade | kevmcfoster | General Discussion | 6 | 10-15-2007 12:25 PM |
| MW Headway - my ideal broker BUT... | fenix | Metatrader brokers | 0 | 05-30-2007 12:46 PM |
| To trade or not to trade Indicators? | yaniv_av | Indicators - Metatrader 4 | 1 | 03-27-2007 01:01 PM |