Gaussian

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #6713 quote
    papero76
    Participant
    Senior

    ciao ho questo codice ma non lavora da un segnale pari a zero.

    come può essere corretto?

    ///////////// Gaussian Filter /////////////
    pr=medianprice
    pi=3.141592654
    if pol>4 then
    pol=4
    endif
    if pol=2 then
    sq=SQRT(2)
    elsif pol=1 then
    sq=2
    elsif pol=3 then
    sq=1.12246
    elsif pol=4 then
    sq=sqrt(sqrt(2))
    endif
    if barindex=0 then
    w=2*pi/per
    w=180*w/pi
    b=(1-cos(w))/(sq-1)
    aa=-b+sqrt(b*b+2*b)
    a1=1-aa
    a12=a1*a1
    a13=a1*a1*a1
    a14=a12*a12
    a2=aa*aa
    a3=aa*aa*aa
    a4=a2*a2
    y1=pr
    y2=y1
    y3=y2
    y4=y3
    endif
    if pol=1 then
    y=aa*pr+a1*y1
    elsif pol=2 then
    y=a2*pr+2*a1*y1-a12*y2
    elsif pol=3 then
    y=a3*pr+3*a1*y1-3*a12*y2+a13*y3
    elsif pol=4 then
    y=a4*pr+4*a1*y1-6*a12*y2+4*a13*y3-a14*y4
    endif
    y4=y3
    y3=y2
    y2=y1
    y1=y
    gauss=y
    return gauss
    
    #6920 quote
    Nicolas
    Keymaster
    Legend

    Ciao questo codice non è completa. Dove l’hai preso?

    #6993 quote
    supertiti
    Participant
    Master

    Qui è il filtro Controllo codice ProRealTime deve essere introdotto ‘pol’ (poli, da 1 a 4) e ‘a’ (tempo predefinito 20) come variabili

    Nicolas and papero76 thanked this post
    Gaussian-filter.jpg Gaussian-filter.jpg
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Gaussian


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
papero76 @papero76 Participant
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by supertiti
10 years, 4 months ago.

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 05/10/2016
Status: Active
Attachments: No files
Logo Logo
Loading...