- Katılım
- 23 Eki 2020
- Mesajlar
- 1,828
Has anyone written any MS or AB code to solve for cointegration? If not, does anyone have the forumula in English so that I could try to code it to be shared by all? I'm trying to improve on my "pairs" trading systems that are currently just using correlation coefficients. fmlvar I never got it got much out of it. Good concept though. If you get it right fix and repost Donald | ||||||
| ||||||
Correlation Coefficient pds:=.3; l1:={FmlVar("xvss","Vv")}C; y1:= {(Trough(1,L1,pds))}l1; y2:= (Trough(1,L1,pds)); y3:= (Trough(2,L1,pds)); x1:= {(TroughBars(1,L1,pds))}1; x2:= (TroughBars(1,L1,pds)); x3:= (TroughBars(2,L1,pds)); ex:=x1+x2+x3; ey:=y1+y2+y3; exy:=(x1*y1)+(x2*y2)+(x3*y3); xsqrt:=(x1*x1)+(x2*x2)+(x3*x3); ysqrt:=(y1*y1)+(y2*y2)+(y3*y3); Vv:=((3*exy)-(ex*ey))/(Sqrt((3*xsqrt)-(ex*ex))* Sqrt((3*ysqrt)-(ey*ey)))*-1; Vv;
|