76felix
Moderatore
eccolo
det=DPO[k*2](close)
c=(k-(n*wa))
if c<=0 then
c=k
flag2=0
endif
det2=DPO[c*2](close)
if det=det[1] and det[1]=det[2] and det[2]<>det[3] then
flag=1
endif
if det2=det2[1] and det2[1]=det2[2] and det2[2]<>det2[3] then
flag2=1
endif
if flag=0 then
hurst=undefined
elsif flag2=1 then
hurst=undefined
else
a=a+1
x=(360/wa)*a
phase=-90
w1=SIN(8*x+phase)
w2=2*SIN(4*x+phase)
w3=3*SIN(2*x+phase)
w4=4*SIN(x+phase)
ciclo=w1+w2+w3+w4
grc=0.01029
c=(grc*trend*1)
b=b+c
hurst=ciclo+b
endif
RETURN hurst
----------------poi devi aggiungere le 4 variabili :
- k è il numero di barra contando da destra dalla quale far partire il ciclo
- n è il numero di cicli che si vogliono plottare
- wa è la lunghezza del ciclo in barre
- trend è il trend per definizione -1, 0 o +1
det=DPO[k*2](close)
c=(k-(n*wa))
if c<=0 then
c=k
flag2=0
endif
det2=DPO[c*2](close)
if det=det[1] and det[1]=det[2] and det[2]<>det[3] then
flag=1
endif
if det2=det2[1] and det2[1]=det2[2] and det2[2]<>det2[3] then
flag2=1
endif
if flag=0 then
hurst=undefined
elsif flag2=1 then
hurst=undefined
else
a=a+1
x=(360/wa)*a
phase=-90
w1=SIN(8*x+phase)
w2=2*SIN(4*x+phase)
w3=3*SIN(2*x+phase)
w4=4*SIN(x+phase)
ciclo=w1+w2+w3+w4
grc=0.01029
c=(grc*trend*1)
b=b+c
hurst=ciclo+b
endif
RETURN hurst
----------------poi devi aggiungere le 4 variabili :
- k è il numero di barra contando da destra dalla quale far partire il ciclo
- n è il numero di cicli che si vogliono plottare
- wa è la lunghezza del ciclo in barre
- trend è il trend per definizione -1, 0 o +1