Log in

Figuring out how to scan the cycles => ANTICIPATION

By jaguar1637 3444 days ago Comments (26)


The goal is to fetch from the additional statistical test result (Bartels score) of over 98% to confirm the actual presence of the cycles inside the data series.

For financial datas, due to the fact, there are a lot's of noise from news and HFT, the Bartels score should be greather than 55%

=> Cycle Length// Amplitude // date Cycle Low // Cycle Strength // Real Cycle PErcent (the Bartels Value)

So , in this aim, the first step is to fetch the cycles existence and analyzing those cycles and build a composite cycle based on several and different cycles



  • jaguar1637 3443 days ago

    The Anderson-Darling test is defined as:

    H0: The data follow a specified distribution.
    Ha: The data do not follow the specified distribution
    Test Statistic: The Anderson-Darling test statistic is defined asA**2 = -N - Swhere

    S=SUM(i=1 to N)((2*i - 1)/N)*[LN(F(Y(i)) + LN(1 - F(Y(N+1-i))]

    F is the cumulative distribution function of the specified distribution. Note that the Yi are the ordered data.

  • jaguar1637 3443 days ago

    Why the Anderson test is here ? bcoz it 's written it coulld be better than the Bartels modified test

  • jaguar1637 3443 days ago

    Jump to another Jump !

    Furthermore , Cramer-Von Mises code seemed to be simplier than the Anderson, in the Anderson test, some weights are more taken into account than other


  • jaguar1637 3443 days ago

    The test of Cramer-von Mises has the same applications as the Kolmogorov.

    The difference between these two tests, is in the fact that, for the Kolmogorov test, only the maximum difference between the empirical distribution and the distribution of adjustment is seen while, in the same time, in the course deviation, the indicator Cramer-Von Mises takes better account of all the data becoz the sum of the deviations occurs.

    The Kolmogorov is much more sensitive to the existence of points in a sample abérents test Cramer-Von Mises.

    It is generally believed that the latter test is more powerful, but it has not been demonstrated theoretically.

    In conclusion, from the bartels, we jump to the Anderson-Darling test statistic, we got to the Cramer-Von Mises code, and may be the Kolmogorov test for the futur

    I repeat the aim is to fetch the dominant cycles in a market (in daily TF) and apply it as an indicator (like Goertlzer Cycle)

  • jaguar1637 3443 days ago

    Cramer-Von Mises test


    \begin{displaymath}I = \frac{1}{12n} + \sum_{i=1}^{n} \left[ \frac{2i-1}{2n} - F^*(x_i) \right]^2 \end{displaymath}

    I got the other form of the equation



    F(X(j)) is the function of repartition

  • jaguar1637 3443 days ago

    The distribution function indicates the probability corresponding to each possible value of the random variable.

  • JohnLast 3443 days ago

    I think I had a terrible day that is why I am so sarcastic. However what about detecting cycles not directly over the price but on the volatility and on the fractal dimension.

    I remember how it was discussed some years ago on Forex TSD the cycles trading, some were saying "if only we had Goertzel we can make it". 

  • jaguar1637 3443 days ago

    No problem, me too !  My noose starts to bleed w/o any explanation.

    Goertzel is there. Now, I am thinking about how to calculate the function distribution (repartition)

  • jaguar1637 3441 days ago

    Today, I can understand that our goal is ANTICIPATION

    - to create an indicator to detect cycles , big and short ones

    The perfect EA following the Trend will take into account the cycles as weeights


  • jaguar1637 3441 days ago

    As far as I can understand, anticipation is not using an algorithm that based trades levels on the total orders flow from all of their cumulative volume

    Anticipation is to know which are the cycles, when the cycles are coming up and when they stop

  • JohnLast 3441 days ago

    I see but cycles analysis may be obvious as a concept but in practice it is difficult to make it work.

    Many threads are dedicated on this problem. The reason for me is that the price line we have in mt4 is just recording the activity of many agents and institutions that enter in very complex intereactions and there are many event based processes.

    What I have seen are cycles in volatility and predictability.

  • jaguar1637 3441 days ago


    I think a practical example will show better this concept

    perceptron = a1*w1 + a2*w2...

    Indeed, if we make a perceptron based on a fractal indicator, we can increase the weights in relation w/ direction of short cycles. So, w/ w(1->n) for PFE's values and a(1->n) for the weights provided by a cycle indicator as (Goertlzer, Sinewave, Elliot...), 

    The weights can be tunned w/ the values provided by the cycle indicators. Imagine this new concept of perceptron based on cycles

    first case :

    we are in a begin of a cycle (from -100 to 100 for simplification) that gives values of - 75 (the previous one is -80  )

    PFE100 (from  0 to 100 for simplification) gives values +30, so the first factor a1*(minus w1) = (30*(minus -75) = +2250, so, the trade LONG is very attractive

    Second case:

    we are at the top of a cycle , that gives the value (90) , so, the market should become bearish soon

    PFE100 gives a value of (+30 ), the first factor a1*(minus w1 ) = (30 *(-90) = -2250

    so, the LONG trade is not any more interesting


    Of course, there is a logic to find, may be a cycle kernel . Do you agree, John ?


  • JohnLast 3441 days ago

    I see your point, indeed that is logical and now I understands more and I like it. It is very original to combine weights and cycle information.


  • jaguar1637 3441 days ago

    Yep, This is the perceptron PFE, and the weights by "Goertzler Cycle" for download

  • JohnLast 3440 days ago

    I will post something different. It is completely offtopic but still it amazed me. 

    I will plot the declinations of the moon and the  EURUSD. I was surprised to see that:


    От technical outllok

     This is a good candidate for Weird or What? The bottom oscillations are the declinations of the moon. 

  • jaguar1637 3440 days ago

    Yes, I always noticed a change at each full moon 

    Sounds esoteric (I have to escape to this world, I trust much more the inner will and internal faith in myself)

    But, OK, I will write an indicator for phase moons and create a perceptron PFE (but for Daily or weekly tfs), but if it was yet written, if someone could put it on beathespread, it will be great!

  • JohnLast 3440 days ago

    I think that could be an analytic framework. This is daily frame after all. But I was very susrprised to see that. After all it looks hide away the preconceptions and check. It would be wise to check the dependances objectively and statistically and not to rely on the preconceptions that Jupiter is bullish and Saturn is bearish.

    Two explications can be made. 

    1. This is self fulfilling prophecy: a lot of people actually believe and act on that information

    2. This has really to do with psychology

    Anyway good night to all.


  • Jack1 3361 days ago

    At first time, I use Goertzel Browser. It seem works, not bad. I haven't checked code of iGoertzel( ). Is it correct?

    This indicator is reprinted, and moving peak/trough with time forward.  See my chart shot.


    It can't be used as continue indicator for forward catching cycle. It is tool for analysis of past cycles in price.



  • jaguar1637 3361 days ago

    Hi jack1

    I wrote a new type of indicator, that is able to predict many bars in advance the break outs.

    This is the PFEHP_Entry_Exit and it corrected release. Did I sent them to you ?

    There based on a selected amplitude of fractals found on the Hodrick prescott

  • jaguar1637 3361 days ago

    Those both indicators are able to predict the future, and in my humble opinion, are more interesting than Goertzel Brower. Try it !

  • jaguar1637 3207 days ago

    HI all

    Boxter just told me this : "I guess you are also aware that the Bartels test is available in R. Using the R bridge of 7bit it should work.
    R for Metatrader
    Bartels test

    we should make a test w/ those new features

  • Boxter 3207 days ago

    Hi guys,
    7bit has implemented two "Indi EAs", arbomat and trendomat, which show pretty well how to use the R bridge in mql4. There are also other Stat-Arb EAs available using this R bridge (e.g. for co-integration testing). Unfortunately I don't have the time right now to implement the Bartel's test on my own.

    In the "old" Antony Herbst book "Analyzing and Forecasting Futures Prices" Antony is claiming good forecast results with combined "significant" cycles (e.g. Goertzel) each not exceeding a Bartel's test result of 0.2.

  • jaguar1637 3207 days ago

    Yep, I tried from my side to play w/ R, 2 or 3 years ago but, I was not successfull


  • Boxter 3164 days ago

    Hi there, I checked the Bartels test of the R lawstat package once more (http://cran.r-project.org/web/packages/lawstat/lawstat.pdf ) . This Bartels test is NOT the cycle significance test ! It is the Bartels test for randomness which is based on the ranked version of von Neumann's ratio (RVN). It's used for testing randomness sequences in time series (see also http://www.jstor.org/discover/10.2307/2287767?uid=3737864&uid=2129&uid=2&uid=70&uid=4&sid=21102850734553 ). 

    The Bartel's test of significance ist best described at http://www.cyclesresearchinstitute.org/cycles-general/bartel.pdf . But there is a small bug in Table III on the last page: The column  A^2 - B^2 must be A^2 + B^2 . I am currently in process to implement the test for the Goertzel browser. At least from the math side it should be possible even in mql4. I am using time series endpoint flattening for the considered cycles from Meyer's "The Adaptive 10 Cycle Goertzel DFT System" (google the paper).

  • Raj Svrinisan 3040 days ago

    Nice work Boxter. EPF is mandatory for tools such as Goertzel. And a good Bartels test as well. While at it, you might consider, if you have not already done so, to add Cycle Strength, since many believe the cycle with largest Amplitude is dominant. However, I believe this is not the case. Amplitude/Period shows real strenght IMO.

    Cheers, Raj.