PureBytes Links
Trading Reference Links
|
There is a soft who make something like your moving average
Here is a similar code on a French soft GraphAT , I don't know the
language, so I have no idea, I just copy it from an other site (PRO-
AT)
I will put a copy of a similar picture made with esignal in the file
but you can see a lot of picture on pro-at
The adress to have more info is
http://www.pro-at.com/forums/topic.asp?TOPIC_ID=6593&whichpage=43
They call that non parametric regression
the soft is
PROGRAMME :
----------------------------------------------------------------------
----------------------------------
//REGRESSION NON-PARAMETRIQUE TYPE LOWESS
//V1.6 du 11/09/2004
//
//Calcul du nb de points dans la fenêtre de pondération
//et de la distance du bord au centre de la fenêtre
SI RANGHISTO=1
ALORS
SI MOD(ENTIER(P2*P3),2)=0
ALORS
N=ENTIER(P2*P3)+1
SINON
N=ENTIER(P2*P3)
FINSI
DMAXI= ENTIER(N/2)
FINSI
//Calcul de la régression locale et déplacement du kernel
//
SI RANGHISTO=FINHISTO-P1
ALORS
//Calcul des poids de proximité W(k) du kernel
//centré sur le point de départ
//
POUR (P2+DMAXI+1) COURS
W(0)=(1-(ABSOLU((-DMAXI-1+RANGPOUR)/DMAXI))^3)^3
W(2*((RANGPOUR-1)-DMAXI))=W(0)
SI RANGPOUR=(DMAXI+1) ALORS BREAK
FINPOUR
//Calcul de la régression locale
//
POUR (P2-DMAXI+1) COURS
POUR N COURS
X(0)=RANGPOUR
Y(0)=CLOTURE
FINPOUR
A=SOMME(W,N)
B=SOMME(W*X,N)
C=SOMME(W*Y,N)
D=SOMME(W*X*Y,N)
E=SOMME(W*X*X,N)
ALPHA=(A*D-B*C)/(A*E-B*B)
BETA=(C*E-B*D)/(A*E-B*B)
LOWESS(DMAXI)=ALPHA*X(DMAXI)+BETA
//Decalage de la fenêtre du kernel
//
SI RANGPOUR <=P2-DMAXI
ALORS
POUR N COURS
W(2*RANGPOUR-(N+2))=W(2*RANGPOUR-(N+1))
FINPOUR
FINSI
FINPOUR
//Traitement des derniers cas
//
J=1
TANTQUE J<=DMAXI FAIRE
//Déplacement fenêtre de pondération
POUR (N-J+1) COURS
W(2*RANGPOUR-(N-J+3))=W(2*RANGPOUR-(N-J+2))
FINPOUR
//Régression locale sur les derniers cas
POUR (N-J) COURS
X(0)=RANGPOUR
Y(0)=CLOTURE
FINPOUR
A=SOMME(W,N-J)
B=SOMME(W*X,N-J)
C=SOMME(W*Y,N-J)
D=SOMME(W*X*Y,N-J)
E=SOMME(W*X*X,N-J)
ALPHA=(A*D-B*C)/(A*E-B*B)
BETA=(C*E-B*D)/(A*E-B*B)
LOWESS(DMAXI-J)=ALPHA*X(DMAXI-J)+BETA
J=J+1
FINTANTQUE
FINSI
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
of course it's all in French
The conversation to see more picture is
http://www.pro-at.com/forums/topic.asp?TOPIC_ID=16488
------------------------ Yahoo! Groups Sponsor --------------------~-->
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/BefplB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/equismetastock/
<*> To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|