预判大盘的利器:时间趋势动力线指标
MA1:向前引用(简单移动平均(收盘价,3),3),LINETHICK2,COLORRED;
fbars:=系统参数(3)-1;
tj:=第一个条件成立位置(收盘价)>fbars-3;
fc:=MA1;
fo:=MA1;
fl:=最低值(MA1,2);
fh:=最高值(MA1,2);
<%
vbars=ffl.vardata("fbars")
vc=ffl.vardata("fc")
vo=ffl.vardata("fo")
vh=ffl.vardata("fh")
vl=ffl.vardata("fl")
vend=ubound(vc)
n=3
if vbars<=vend and vbars>vend-vbars+n then
redim temp(vend-vbars+n,3)
for i=2*vbars-vend-n to vbars
ii=i+vend-2*vbars+n
temp(ii,0)=2*vc(vbars)-vo(i)
temp(ii,1)=2*vc(vbars)-vh(i)
temp(ii,2)=2*vc(vbars)-vl(i)
temp(ii,3)=2*vc(vbars)-vc(i)
next
for i=vbars-n to vend
ii=vend-i
vo(i)=temp(ii,3)
vh(i)=temp(ii,2)
vl(i)=temp(ii,1)
vc(i)=temp(ii,0)
next
ffl.vardata("fc")=vc
ffl.vardata("fo")=vo
ffl.vardata("fh")=vh
ffl.vardata("fl")=vl
end if
%>
画分段线(tj,fc),shift3;
MA3:向前引用(简单移动平均(收盘价,25),5),LINETHICK2,COLORBLUE;
fbars:=系统参数(3)-1;
tj:=第一个条件成立位置(收盘价)>fbars-3;
fc:=MA3;
fo:=MA3;
fl:=最低值(MA3,2);
fh:=最高值(MA3,2);
<%
vbars=ffl.vardata("fbars")
vc=ffl.vardata("fc")
vo=ffl.vardata("fo")
vh=ffl.vardata("fh")
vl=ffl.vardata("fl")
vend=ubound(vc)
n=3
if vbars<=vend and vbars>vend-vbars+n then
redim temp(vend-vbars+n,3)
for i=2*vbars-vend-n to vbars
ii=i+vend-2*vbars+n
temp(ii,0)=2*vc(vbars)-vo(i)
temp(ii,1)=2*vc(vbars)-vh(i)
temp(ii,2)=2*vc(vbars)-vl(i)
temp(ii,3)=2*vc(vbars)-vc(i)
next
for i=vbars-n to vend
ii=vend-i
vo(i)=temp(ii,3)
vh(i)=temp(ii,2)
vl(i)=temp(ii,1)
vc(i)=temp(ii,0)
next
ffl.vardata("fc")=vc
ffl.vardata("fo")=vo
ffl.vardata("fh")=vh
ffl.vardata("fl")=vl
end if
%>
画分段线(tj,fc),shift3 |