飞狐趋势环主图指标公式
2015-1-4 21:26:39点击:
input: n(13,6,40);
fo:=if(checkuser(1),o,0);
fh:=if(checkuser(1),h,0);
fl:=if(checkuser(1),l,0);
fc:=if(checkuser(1),c,0);
<%
vo=ffl.vardata("fo")
vh=ffl.vardata("fh")
vl=ffl.vardata("fl")
vc=ffl.vardata("fc")
last=ubound(vc)
vc(0)=(vh(0)+vl(0)+2*vc(0))/4
for i=1 to last
vo(i)=(vo(i-1)+vc(i-1))/2
if vo(i)>vh(i) then vh(i)=vo(i) else vh(i)=vh(i)
if vo(i)<vl(i) then vl(i)=vo(i) else vl(i)=vl(i)
vc(i)=(2*vc(i)+vh(i)+vl(i))/4
next
ffl.vardata("fo")=vo
ffl.vardata("fh")=vh
ffl.vardata("fl")=vl
ffl.vardata("fc")=vc
%>
kk:=if(fc>=fo and (fc>=ref(fc,1) or ref(fc,1)>=ref(fo,1)),1,if(fc<fo and (fc<ref(fo,1) or ref(fc,1)<ref(fo,1)),-1,0));
明:(fo+fc)/2,shift1,colorff00;
转:=if(kk=1,min(fc,fo),if(kk=-1,max(fc,fo),if(ref(kk,1)=1,min(fc,fo),if(ref(kk,1)=-1,max(fc,fo),(fc+fo)/2))));
drawnumber(islastbar,明,明,2),shift1;
drawnumber(islastbar,if(fc>fo,明*0.97,明*1.03),转,2),shift1;
中:=ma(c,n);
天:=中+2*stdp(c,n);
罗:=中+stdp(c,n);
地:=中-stdp(c,n);
网:=中-2*stdp(c,n);
mk:=if(kk=1,h,if(kk=-1,c,if(ref(kk,1)=1,h,c)));
cir1:if(max(c,o)>中 and l>地 and 明>地,明+0.2*sqrt(ma((mk+中)*(mk-中),3)),明),colorff00ff;
cir2:if(max(c,o)>中 and l>地 and 明>地,明-0.2*sqrt(ma((mk+中)*(mk-中),3)),明),colorff00ff;
stickline(kk=1,min(fo,fc),min(fo,fc)+abs(fc-fo)*1/8,8,0),colorff;
stickline(kk=1,min(fo,fc)+abs(fc-fo)*1/8,min(fo,fc)+abs(fc-fo)*2/8,8,0),color33ff;
stickline(kk=1,min(fo,fc)+abs(fc-fo)*2/8,min(fo,fc)+abs(fc-fo)*3/8,8,0),color66ff;
stickline(kk=1,min(fo,fc)+abs(fc-fo)*3/8,min(fo,fc)+abs(fc-fo)*4/8,8,0),color99ff;
stickline(kk=1,min(fo,fc)+abs(fc-fo)*4/8,min(fo,fc)+abs(fc-fo)*5/8,8,0),colorbbff;
stickline(kk=1,min(fo,fc)+abs(fc-fo)*5/8,min(fo,fc)+abs(fc-fo)*6/8,8,0),colorccff;
stickline(kk=1,min(fo,fc)+abs(fc-fo)*6/8,min(fo,fc)+abs(fc-fo)*7/8,8,0),coloreeff;
stickline(kk=1,min(fo,fc)+abs(fc-fo)*7/8,min(fo,fc)+abs(fc-fo)*8/8,8,0),colorffff;
stickline(kk=-1,min(fo,fc),min(fo,fc)+abs(fc-fo)*1/8,8,0),colorffff;
stickline(kk=-1,min(fo,fc)+abs(fc-fo)*1/8,min(fo,fc)+abs(fc-fo)*2/8,8,0),colorffee00;
stickline(kk=-1,min(fo,fc)+abs(fc-fo)*2/8,min(fo,fc)+abs(fc-fo)*3/8,8,0),colorffcc00;
stickline(kk=-1,min(fo,fc)+abs(fc-fo)*3/8,min(fo,fc)+abs(fc-fo)*4/8,8,0),colorffaa00;
stickline(kk=-1,min(fo,fc)+abs(fc-fo)*4/8,min(fo,fc)+abs(fc-fo)*5/8,8,0),colorff8800;
stickline(kk=-1,min(fo,fc)+abs(fc-fo)*5/8,min(fo,fc)+abs(fc-fo)*6/8,8,0),colorff6600;
stickline(kk=-1,min(fo,fc)+abs(fc-fo)*6/8,min(fo,fc)+abs(fc-fo)*7/8,8,0),colorff3300;
stickline(kk=-1,min(fo,fc)+abs(fc-fo)*7/8,min(fo,fc)+abs(fc-fo)*8/8,8,0),colorff0000;
stickline(fc>fo,fh,fc,0.4,0),colorff;
stickline(fc>fo,fo,fl,0.4,0),colorff;
stickline(fo>fc,fh,fo,0.4,0),colorffff00;
stickline(fo>fc,fc,fl,0.4,0),colorffff00;
stickline(kk=0 and fc>=fo,fo,fc,8,1),colorff00ff;
stickline(kk=0 and fc<fo,fo,fc,8,0),colorff00ff;
fo:=if(checkuser(1),o,0);
fh:=if(checkuser(1),h,0);
fl:=if(checkuser(1),l,0);
fc:=if(checkuser(1),c,0);
<%
vo=ffl.vardata("fo")
vh=ffl.vardata("fh")
vl=ffl.vardata("fl")
vc=ffl.vardata("fc")
last=ubound(vc)
vc(0)=(vh(0)+vl(0)+2*vc(0))/4
for i=1 to last
vo(i)=(vo(i-1)+vc(i-1))/2
if vo(i)>vh(i) then vh(i)=vo(i) else vh(i)=vh(i)
if vo(i)<vl(i) then vl(i)=vo(i) else vl(i)=vl(i)
vc(i)=(2*vc(i)+vh(i)+vl(i))/4
next
ffl.vardata("fo")=vo
ffl.vardata("fh")=vh
ffl.vardata("fl")=vl
ffl.vardata("fc")=vc
%>
kk:=if(fc>=fo and (fc>=ref(fc,1) or ref(fc,1)>=ref(fo,1)),1,if(fc<fo and (fc<ref(fo,1) or ref(fc,1)<ref(fo,1)),-1,0));
明:(fo+fc)/2,shift1,colorff00;
转:=if(kk=1,min(fc,fo),if(kk=-1,max(fc,fo),if(ref(kk,1)=1,min(fc,fo),if(ref(kk,1)=-1,max(fc,fo),(fc+fo)/2))));
drawnumber(islastbar,明,明,2),shift1;
drawnumber(islastbar,if(fc>fo,明*0.97,明*1.03),转,2),shift1;
中:=ma(c,n);
天:=中+2*stdp(c,n);
罗:=中+stdp(c,n);
地:=中-stdp(c,n);
网:=中-2*stdp(c,n);
mk:=if(kk=1,h,if(kk=-1,c,if(ref(kk,1)=1,h,c)));
cir1:if(max(c,o)>中 and l>地 and 明>地,明+0.2*sqrt(ma((mk+中)*(mk-中),3)),明),colorff00ff;
cir2:if(max(c,o)>中 and l>地 and 明>地,明-0.2*sqrt(ma((mk+中)*(mk-中),3)),明),colorff00ff;
stickline(kk=1,min(fo,fc),min(fo,fc)+abs(fc-fo)*1/8,8,0),colorff;
stickline(kk=1,min(fo,fc)+abs(fc-fo)*1/8,min(fo,fc)+abs(fc-fo)*2/8,8,0),color33ff;
stickline(kk=1,min(fo,fc)+abs(fc-fo)*2/8,min(fo,fc)+abs(fc-fo)*3/8,8,0),color66ff;
stickline(kk=1,min(fo,fc)+abs(fc-fo)*3/8,min(fo,fc)+abs(fc-fo)*4/8,8,0),color99ff;
stickline(kk=1,min(fo,fc)+abs(fc-fo)*4/8,min(fo,fc)+abs(fc-fo)*5/8,8,0),colorbbff;
stickline(kk=1,min(fo,fc)+abs(fc-fo)*5/8,min(fo,fc)+abs(fc-fo)*6/8,8,0),colorccff;
stickline(kk=1,min(fo,fc)+abs(fc-fo)*6/8,min(fo,fc)+abs(fc-fo)*7/8,8,0),coloreeff;
stickline(kk=1,min(fo,fc)+abs(fc-fo)*7/8,min(fo,fc)+abs(fc-fo)*8/8,8,0),colorffff;
stickline(kk=-1,min(fo,fc),min(fo,fc)+abs(fc-fo)*1/8,8,0),colorffff;
stickline(kk=-1,min(fo,fc)+abs(fc-fo)*1/8,min(fo,fc)+abs(fc-fo)*2/8,8,0),colorffee00;
stickline(kk=-1,min(fo,fc)+abs(fc-fo)*2/8,min(fo,fc)+abs(fc-fo)*3/8,8,0),colorffcc00;
stickline(kk=-1,min(fo,fc)+abs(fc-fo)*3/8,min(fo,fc)+abs(fc-fo)*4/8,8,0),colorffaa00;
stickline(kk=-1,min(fo,fc)+abs(fc-fo)*4/8,min(fo,fc)+abs(fc-fo)*5/8,8,0),colorff8800;
stickline(kk=-1,min(fo,fc)+abs(fc-fo)*5/8,min(fo,fc)+abs(fc-fo)*6/8,8,0),colorff6600;
stickline(kk=-1,min(fo,fc)+abs(fc-fo)*6/8,min(fo,fc)+abs(fc-fo)*7/8,8,0),colorff3300;
stickline(kk=-1,min(fo,fc)+abs(fc-fo)*7/8,min(fo,fc)+abs(fc-fo)*8/8,8,0),colorff0000;
stickline(fc>fo,fh,fc,0.4,0),colorff;
stickline(fc>fo,fo,fl,0.4,0),colorff;
stickline(fo>fc,fh,fo,0.4,0),colorffff00;
stickline(fo>fc,fc,fl,0.4,0),colorffff00;
stickline(kk=0 and fc>=fo,fo,fc,8,1),colorff00ff;
stickline(kk=0 and fc<fo,fo,fc,8,0),colorff00ff;
- 上一篇:飞狐易经宝典指标公式 2015/1/4
- 下一篇:飞狐四合一背离指标公式 2015/1/4