Can anyone translate French to explain the Goertzel Amp, Period & Phase Algo

Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • #15834 quote
    Bard
    Participant
    Master

    Hi.

    Can anyone please explain this indicator as my French is limited. See: http://hk-lisse.over-blog.com and the Blog Post on the 14th May 2009 (bottom 1/3rd of the page)

    The original French description is:

    “Dans le dernier article sur l’algorithme de Goertzel, le programme permettait de retrouver les 2 périodes des cycles qui avaient la meilleure réponse.  Je l’ai complèté et corrigé pour qu’il sorte également l’amplitude correcte du cycle ainsi que la phase : cela afin de pouvoir redessiner la courbe.
    Dans l’exemple ci-dessous, le signal (en noir) est une sinusoïde de période 11 ajoutée à une sinusoïde de période 19 (d’amplitude 2) avec un décalage de phase (90),  le tout avec une pincée de bruit..   Les 2 courbes (rouge et bleue) sont reconstruites par le programme, il reste à les superposer pour avoir le signal sans bruit.”

    Which I have “translated” as:

    “In the last article on the Goertzel algorithm, the program allowed to find the 2 periods of cycles that had the best answer/fit. I completed and corrected it to also ensure the correct amplitude of the cycle and the phase in order to redraw the curve. In the example below, the signal (black) is an 11 period sinewave added to a 19 period sinewave (amplitude 2) with a phase shift (of 90 degrees), all with only a tiny bit of noise. The two curves (red and blue) are reconstructed by the program, it remains to superimpose to have the signal without noise.”

    But this translation doesn’t really help me fully understand the indicator and how to use it or what to set the value of K to?
    I am not clear in how this algorithm indicator helps predict the turning points in a market although I am familiar with John Ehler’s MESA Cycle/Phase concepts. I guess a good translation would be a start. It seems John Meyer gets good trading system results with high % of winning trades with good profit factors using the Goertzel Algorithm.

    Any help would be great,
    Thanks in advance,

     

    ProRealTime Code:

    //k = the frequency already found//
    // sous prgm goertzel  biss //
    
    a=barindex
    sig=sin(360*a/11)+2*sin(360*a/19+90)
    b=SQRT(barindex*(b+1))
    b=abs((b-ROUND(b))*4)
    c=b-1
    sig=sig+c
    n=200
    pr=sig
    alpha=2*cos(360*1/k)
    q1=0
    q2=0
    
    for i=n downto 0//fenêtre de 200 barres
    q3=pr[i]+alpha*q1-q2
    q2=q1
    q1=q3
    next
    
    amp=sqrt(square(q1)+square(q2)-alpha*q1*q2)
    real=q1-(alpha*q2)/2
    imag=q2*sin(360*1/k)
    phas=atan(imag/real)
    
    if real<0 then
    phas=phas+180
    elsif real>=0 and imag<0 then
    phas=phas+360
    endif
    
    return (2*amp/n)*sin(360/k+phas[1]+90),sig
    #15838 quote
    Nicolas
    Keymaster
    Master

    k is the period of the signal previously found by the Goertzel algorithm. The main article (this one is the second) is in the “Cycles” category of the blog. I knew them already, but these codes are stunning! 🙂

    #15848 quote
    Bard
    Participant
    Master

    Thanks Nicolas,

    Do you think the clue was at the beginning of the paragraph: “In the last article on the Goertzel algorithm” ?
    I agree. It is very clever what Ehler’s and Meyer’s have done.

    I was wondering why did Meyer’s use a 11 period cycles combined with a 19 period cycles. Why specifically 11 and 19?

    Also “prgm goertzel” has a call function: CALL “goertzel sous.” I assume that’s the “sous prgm goertzel” code? Shouldn’t it be renamed “goertzel sous” ?

    For the ease of finding all these indicators in my Indicator List I renamed “prgm goertzel” to “Cycle Prgm Goertzel” and renamed “prgm goertzel: to “Cycle Prgm Goertzel.”

    When I tried changing the Call function name within indicator “Cycle Prgm Goertzel” to “Cycle Sous Prgm Goertzel” I got the error below in the image?

     

    This is the code for “prgm goertzel” (now called Cycle Prgm Goertzel)

    l=0
    maxi=l
    maxo=0
    for p=5 to 25//détection de cycle de période de 5 à 25
    
    my = CALL "goertzel sous"[p]
    if my>maxi then
    per=p
    maxi=my
    endif
    if my>maxo and my<maxi then
    peri=p
    maxo=my
    endif
    next
    return max(per,peri),min(per,peri)

     

    Shouldn’t you be on a break from inane questions by ‘newbies’? (-;

    Cheers Nicolas

    #15911 quote
    Nicolas
    Keymaster
    Master

    >> For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text of the code part! Thank you! <<

    I think you need to change the CALL function on line 6 to the correct new name of your indicator. Please use the attachments form  if you need to attach screenshots.

    #16252 quote
    Bard
    Participant
    Master
    Thanks Nicolas, Do you know why when I click on the add url link when trying to post a comment the page jumps down to the bottom of the page? It was doing that specifically on the Kase Peak Oscillator page despite clearing cookies: http://www.prorealcode.com/prorealtime-indicators/kase-peak-oscillator/ This page I’m on now clearly works but I have has lots of incidents like this? Cheers.
    #16257 quote
    Nicolas
    Keymaster
    Master
    Yes this is a bug of the comment engine, this is on my to-do list 🙂 But you can type also URL in the comment without adding them with the link button, the URL will be automatically converted to a clickable link by the website.
    #17903 quote
    Bard
    Participant
    Master
    Hi Nicolas, I can’t get the Goertzel indicator: goertzel prgm from: Part 2 http://hk-lisse.over-blog.com/article-23944329.html to work. I have tried with the original names and my own naming of these indicators but I get an error, pls see image. The original code I have for goertzel prgm is below. The goertzel sous indicator is named exactly: goertzel sous Any ideas what is causing the errors? Once I have these indicators (please see 2nd charts screenshot) , I am not sure how to interpret them or how value of K is determined – from Part 1 – using the sous prgm goertzel? Any help would be much appreciated, Cheers Brad
    // prgm goertzel // Goertzel Program//
    l=0
    maxi=l
    maxo=0
    for p=5 to 25//détection de cycle de période de 5 à 25
    my = CALL "goertzel sous"[p] 
    if my>maxi then
    per=p
    maxi=my
    endif
    if my>maxo and my<maxi then
    peri=p
    maxo=my
    endif
    next
    return max(per,peri),min(per,peri)
    
    
    
    
    
    
    Screen-Shot-2016-12-06-at-21.02.09.png Screen-Shot-2016-12-06-at-21.02.09.png Screen-Shot-2016-12-06-at-20.55.31.png Screen-Shot-2016-12-06-at-20.55.31.png
    #22300 quote
    Bard
    Participant
    Master
    Hello Nicolas, Do you know how I can get this “prgm goertzel” to work? I deleted them all and re entered the indicators from the hk-lisse blog – please see screen. Is is just the prgm goertzel that is missing and which gives you the K value, right?. The error message seems to be because of the [p] in the code after the call function. If you take it out it will load a non functioning chart. Cheers and a late Happy New Year to you, Brad
    // prgm goertzel // Goertzel Program//
    l=0
    maxi=l
    maxo=0
    for p=5 to 25//détection de cycle de période de 5 à 25
    my = CALL "goertzel sous" [p]
    if my>maxi then
    per=p
    maxi=my
    endif
    if my>maxo and my<maxi then
    peri=p
    maxo=my
    endif
    next
    return max(per,peri),min(per,peri)
    
    Screen-Shot-2017-01-24-at-15.50.36.png Screen-Shot-2017-01-24-at-15.50.36.png Screen-Shot-2017-01-24-at-15.54.18.png Screen-Shot-2017-01-24-at-15.54.18.png
    #22341 quote
    Nicolas
    Keymaster
    Master
    Didn’t test it myself, but remove
     [p]
    at line 6 and everything should be ok.
    #22846 quote
    Bard
    Participant
    Master
    Thanks Nicolas, I already tried removing [P] and just got two straight lines, pls see images of Daily Dow Jones: The code for “goertzel sous” called from the program “prgm goertzel” looks okay and the chart indicator loads okay:
    k = 14
    
    a=barindex
    sig=sin(360*a/11)+sin(360*a/19+90)
    b=SQRT(barindex*(b+1))
    b=abs((b-ROUND(b))*4)
    c=b-1
    sig=sig+c
    
    pr=sig
    alpha=2*cos(360*1/k)
    q1=0
    q2=0
    for i=200 downto 0//fenêtre de 200 barres
    q3=pr[i]+alpha*q1-q2
    q2=q1
    q1=q3
    next
    amp=sqrt(square(q1)+square(q2)-alpha*q1*q2)
    return amp
    
    How are you meant to use the three indicators  “sous prgm goertzel biss,” “goertzel sous” and “Goertzel Cycle Signal wo(without) Noise,”? Cheers,
    Screen-Shot-2017-01-28-at-15.03.07.png Screen-Shot-2017-01-28-at-15.03.07.png Screen-Shot-2017-01-28-at-15.04.28.png Screen-Shot-2017-01-28-at-15.04.28.png
    #22907 quote
    Nicolas
    Keymaster
    Master
    Sorry, I think I have answered too quickly in my last post. The “goertzel sous” need a predefined external variable named “k” and that’s the intend of the “p” variable from the CALL function at line 6 of the main program. But this variable was not set external to be called by a CALL instruction, so you have to add it yourself. So, don’t delete “p” from “program” indi and remove “k” from the “sous” indicator (line 1) and add an external “k” variable instead to it (value default is 14, but that’s not important).
    Bard thanked this post
    #23360 quote
    Bard
    Participant
    Master
    No worries,
    I meant to say earlier in this thread was I don’t understood why the dummy values of cycle periods 11 + 19, (used to test the Goertzel Algo against Elher’s methods), are used again as part of the sous prgm goerzel code: (sigsig=sin(360*a/11)+sin(360*a/19+90) for cycle detection ?
    I don’t know how I ended up with k = 14 in the goertzel sous code, it’s from the Ehlers version of the Goertzel algo.
    I deleted the line k=14 in the sous goertzel and added a separate value for it within the code.
     I reloaded prgm goertzel and got this again, pls see screenshot:
    Am I meant to install these in any particular order? I have stripped them out and reloaded them too many times. I really don’t get it! I have never wasted this much time trying to get something to work… The names of the indicators are vague!…. Sous? = Under?
    “k is the period of the signal previously found by the Goertzel algorithm.”What is goertzel sous meant to show? It is of no value as it doesn’t match the cycles in the my chart after I used the period (13) found from the Ehler’s MESA Period for my 1 Hour chart.
     Another name from the article that I don’t understand, Part 2: Sous Program Goertzel Biss?
    Also Ehler’s variation (aka prgm ehlers) of the Goertzel has this line of code calling “sousprog dft” (code from the hk-lisse blog, article 2), yet I don’t see any code for  “sousprog dft” in the article?
    Cheers, Brad //  prgm ehlers //
    mix=0
    maxpwr = CALL "sousprog dft"[8]
    pero=8
    
    for ki=9 to 30//détection de cycle de période de 9 à 30
        mys=call "sousprog dft"[ki]
        if mys>maxpwr then
            maxpwr=mys
            pero=ki
        endif
        if mys>mix and mys<maxpwr then
            mix=mys
            por=ki
        endif
    next
    return pero,por
    #23547 quote
    Bard
    Participant
    Master
    Btw, Nicolas, just to clarify, my comments above on this goertzel issue aren’t a reflection of your skills to solve the issue, as you are effectively doing it blind and aren’t able to see my set up and all the codes I have entered. Everyone else using the hk-lisse blog seems to have been able to use the code and it works (they would have been amended the code if it didn’t). Doesn’t the Ehler’s Universal Supersmoother Oscillator ‘trump’ any of these indicators anyway?
    #48629 quote
    Ermitage
    Participant
    Average
    Any news about thi topic?
    #95657 quote
    Finning
    Participant
    Veteran
    Hi @Nicolas, Is there any way that we could get either Ehler’s MESA and/or the Goertzel algorithm for cycle detection use from the HK-lisse blog operational and uploaded into the Library? The code is 90% there – but the missing CALL functions have made it had to get a final result, and having these indicators available for use I’m sure would be of benefit to some. This would of course only be possible if you knew what these CALL functions should be – the only thing that has stopped me from putting them to use. Thanks for your help, Finning
Viewing 15 posts - 1 through 15 (of 19 total)
  • You must be logged in to reply to this topic.

Can anyone translate French to explain the Goertzel Amp, Period & Phase Algo


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Bard @brad Participant
Summary

This topic contains 18 replies,
has 4 voices, and was last updated by Finning
6 years, 10 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 11/01/2016
Status: Active
Attachments: 7 files
Logo Logo
Loading...