改成飞狐的‘高低射线’
首先向公式的原创作者致敬,然后谢谢论坛的大师们的帮助,可以在飞狐上用了。
注意:进入公式后,必须有光标,否则会乱图。
{高低射线--飞狐}
{1.射线}
x:=BARSLAST(SYSPARAM(2)=BARPOS)+1;
ah:=hhv(SYSPARAM(4),x);
al:=llv(SYSPARAM(5),x);
nnl:=SYSPARAM(3)=BARPOS;
DRAWLINE(h>=ah,ah,ah,ah,1),color0000ff,LINETHICK2;
DRAWLINE(h>=ah,ah,AL>=L,ah,1),color9999ff,LINETHICK2;
DRAWLINE(h>=ah,ah,ah,ah*0.999,1);
DRAWLINE(h>=ah,ah,ah,ah*0.997,1),LINETHICK3;
DRAWLINE(h>=ah,ah,ah,ah*0.995,1),LINETHICK3;
DRAWLINE(h>=ah,ah,ah,ah*0.993,1),LINETHICK3;
DRAWLINE(h>=ah,ah,ah,ah*0.991,1);
DRAWLINE(h>=ah,ah,ah,ah*0.989,1),LINETHICK3;
DRAWLINE(h>=ah,ah,ah,ah*0.987,1);
DRAWLINE(h>=ah,ah,ah,ah*0.984,1),LINETHICK3;
DRAWLINE(h>=ah,ah,ah,ah*0.981,1);
DRAWLINE(h>=ah,ah,ah,ah*0.976,1),LINETHICK3;
DRAWLINE( al>=l,al,al , al,1),color00ff00,LINETHICK2;
DRAWLINE(al>=l,al,nnl ,ah,1),color00ffff,LINETHICK2;
DRAWLINE( al>=l,al,al ,al*1.15,1);
DRAWLINE( al>=l,al,al ,al*1.09,1);
DRAWLINE( al>=l,al,al ,al*1.06,1);
DRAWLINE( al>=l,al,al ,al*1.04,1);
DRAWLINE( al>=l,al,al ,al*1.03,1);
DRAWLINE( al>=l,al,al ,al*1.025,1);
DRAWLINE( al>=l,al,al ,al*1.02,1);
DRAWLINE( al>=l,al,al ,al*1.015,1);
DRAWLINE( al>=l,al,al ,al*1.011,1);
DRAWLINE( al>=l,al,al ,al*1.007,1);
DRAWLINE( al>=l,al,al ,al*1.003,1);
{2.黄金比}
ahl:=ah-al;
q191:=al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HICK2;
DRAWTEXT(nnl,q382,'38.2%:'+NUMTOSTR(q382,2)+'元'),ALIGN0,Color0047FF,LINETHICK2;
DRAWTEXT(nnl,q191,'19.1%:'+NUMTOSTR(q191,2)+'元'),ALIGN0,Color00FFff,LINETHICK2;
DRAWTEXT(nnl,al*1.01,'最低价:'+NUMTOSTR(al,2)+'元'),ALIGN0,PXUP20,Color0047FF,LINETHICK2;
{4.注解}
获利盘:WINNER(CLOSE)*100,LINETHICK0;
DRAWTEXTex(c,0,5,400,'■获利比例: '+NUMTOSTR(获利盘,2)+'%'),Color00FFff,LINETHICK3;
涨幅:(C-Al)/Al*100,LINETHICK0;
DRAWTEXTex(c,0,5,420,'■最低点至今天涨幅为: '+NUMTOSTR(涨幅,1)+' %.'),Color00ff00,LINETHICK3;
涨:(C-AL)/(AH-AL)*100,LINETHICK0;
DRAWTEXTex(c,0,5,440,'■黄金比(最高,最低)为: '+NUMTOSTR(涨,1)+' %.'),Color00ffFF,LINETHICK3;
HH:=HHV(h,5)*0.95;
DRAWTEXTex(c,0,5,460,'■止损=买入价*0.95;'),Color00FF00,LINETHICK3;;
DRAWTEXTex(c,0,5,500,'■止盈(五日内最高价*0.95)='+NUMTOSTR(HH,2)+'元'),Color0000FF,LINETHICK3;
DRAWTEXTex(c,0,5,480,'■五日内最高价='+NUMTOSTR(HHV(h,5),2)+'元'),Color0099FF,LINETHICK3;
DRAWTEXTEX(sysparam(3)=BARPOS,0,5,10,'指标用法:1.
一定要有光标,否则会乱图,很好;'),COLORyellow;
|