ihzx 发表于 2021-8-21 12:50:27

飞狐自动百分箱体主图指标公式

<p>input:k(1,1,3,1);<br />
hh:= SYSPARAM(4);<br />
ll:= SYSPARAM(5);<br />
HL:=hh-ll;<br />
wH := BARSlast(H=hh);<br />
wL :=BARSlast(L=ll);<br />
KK := wH-wL;<br />
a1 :=if(kk&lt;0,hh- HL*0.25,ll+HL*0.25);<br />
a2 :=if(kk&lt;0,hh- HL*0.75,ll+HL*0.75);<br />
a3 :=if(kk&lt;0,hh- HL*0.3125,ll+HL*0.3125);<br />
mHL:= hh-HL*0.5;b1:=if(kk&lt;0,hh- HL*0.125,ll+HL*0.125);b2:=if(kk&lt;0,hh- HL*0.0625,ll+HL*0.0625);b3:=if(kk&lt;0,hh- HL*0.375,ll+HL*0.375);b4:=if(kk&lt;0,hh- HL*0.625,ll+HL*0.625);<br />
b5:=if(kk&lt;0,hh- HL*0.1875,ll+HL*0.1875);b6:=if(kk&lt;0,hh- HL*0.875,ll+HL*0.875);b7:=if(kk&lt;0,hh- HL*0.4375,ll+HL*0.4375);b8:=if(kk&lt;0,hh- HL*0.5625,ll+HL*0.5625);<br />
b9:=if(kk&lt;0,hh- HL*0.6875,ll+HL*0.6875);b10:=if(kk&lt;0,hh- HL*0.9375,ll+HL*0.9375);b11:=if(kk&lt;0,hh- HL*0.8125,ll+HL*0.8125);A := islastbar;<br />
DRAWTEXT(A and K&lt;&gt;3,HH, '最高价:'+NUMTOSTR(HH,2)),ALIGN2,colorred;DRAWTEXT(A and K&lt;&gt;3,LL, '最低价:'+NUMTOSTR(ll,2)),ALIGN2,,COLORCYAN;<br />
{股旁网-股票公式网站 www.gupang.com}<br />
DRAWTEXT(A and K&lt;&gt;3,mHL,'50%:'+NUMTOSTR(mHL,2)),ALIGN2,coloryellow;DRAWTEXT(A and K=1, a1, '25%:'+NUMTOSTR(a1,2)),ALIGN2,coloryellow;<br />
DRAWTEXT(A and K=1, a2, '75%:'+NUMTOSTR(a2,2)),ALIGN2,colorgreen;DRAWTEXT(A and K=1, a3, '31.25%:'+NUMTOSTR(a3,3)),ALIGN2,COLORGRAY;<br />
DRAWTEXT(A and K=1, b1, '12.5%:'+NUMTOSTR(b1,2)),ALIGN2,COLORGRAY;DRAWTEXT(A and K=1, b2, '6.25%:'+NUMTOSTR(b2,2)),ALIGN0,COLORGRAY;<br />
DRAWTEXT(A and K=1, b3, '37.5%:'+NUMTOSTR(b3,2)),ALIGN2,COLORGRAY;DRAWTEXT(A and K=1, b4, '62.5%:'+NUMTOSTR(b4,2)),ALIGN2,COLORGRAY;<br />
DRAWTEXT(A and K=1, b5, '18.75%:'+NUMTOSTR(b5,3)),ALIGN2,COLORGRAY;DRAWTEXT(A and K=1, b6, '87.5%:'+NUMTOSTR(b6,2)),ALIGN2,COLORGRAY;<br />
DRAWTEXT(A and K=1, b7, '43.75%:'+NUMTOSTR(b7,2)),ALIGN2,COLORGRAY;DRAWTEXT(A and K=1, b8, '56.25%:'+NUMTOSTR(b8,2)),ALIGN2,COLORGRAY;<br />
DRAWTEXT(A and K=1, b9, '68.75%:'+NUMTOSTR(b9,2)),ALIGN2,COLORGRAY;DRAWTEXT(A and K=1, b10, ' 93.75%:'+NUMTOSTR(b10,2)),ALIGN2,COLORGRAY;<br />
DRAWTEXT(A and K=1, b11, ' 81.25:'+NUMTOSTR(b11,2)),ALIGN2,COLORGRAY;<br />
DRAWTEXT(A and K=1, b7, '- - - - - - - - - - - - - - - - - -'),ALIGN2,COLORGRAY,linethick7;<br />
DRAWTEXT(A and K=1, b8, '- - - - - - - - - - - - - - - - - -'),ALIGN2,COLORGRAY,linethick7;<br />
DRAWTEXT(A and K=1, b9, '- - - - - - - - - - - - - - - - - -'),ALIGN2,COLORGRAY,linethick7;<br />
DRAWTEXT(A and K=1, b10, '- - - - - - - - - - - - - - - - - -'),ALIGN2,COLORGRAY,linethick7;<br />
DRAWTEXT(A and K=1, b11, '- - - - - - - - - - - - - - - - - -'),ALIGN2,COLORGRAY,linethick7;<br />
DRAWTEXT(A and K&lt;&gt;3,HH, ' ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄'),ALIGN2,colorred,linethick7;<br />
DRAWTEXT(A and K&lt;&gt;3,LL, '--------------------------------------------------------------------------------------------------------------------------------------------------------------------'),ALIGN2,COLORCYAN,linethick7;<br />
DRAWTEXT(A and K&lt;&gt;3,mHL,'-------------------------------------------------------------------------------------------------------------------------------'),ALIGN2,coloryellow,linethick7;<br />
DRAWTEXT(A and K=1, a1, '-------------------------------------------------------------------------------------------------------------------------------'),ALIGN2,COLORMAGENTA,linethick7;<br />
DRAWTEXT(A and K=1, a2, '-------------------------------------------------------------------------------------------------------------------------------'),ALIGN2,colorgreen,linethick7;<br />
DRAWTEXT(A and K=1, a3, '- - - - - - - - - - - - - - - - - -'),ALIGN2,COLORGRAY,linethick7;<br />
DRAWTEXT(A and K=1, b1, '--------------------------------------------------------------------------------------------------'),ALIGN2,COLORGRAY,linethick7;<br />
DRAWTEXT(A and K=1, b2, '- - - - - - - - - - - - - - - - - -'),ALIGN2,COLORGRAY,linethick7;<br />
DRAWTEXT(A and K=1, b3, '--------------------------------------------------------------------------------------------------'),ALIGN2,COLORGRAY,linethick7;<br />
DRAWTEXT(A and K=1, b4, '--------------------------------------------------------------------------------------------------'),ALIGN2,COLORGRAY,linethick7;<br />
DRAWTEXT(A and K=1, b5, '- - - - - - - - - - - - - - - - - -'),ALIGN2,COLORGRAY,linethick7;<br />
DRAWTEXT(A and K=1, b6, '--------------------------------------------------------------------------------------------------'),ALIGN2,COLORGRAY,linethick7;<br />
VAR1:=ZIG(3,10)&lt;REF(ZIG(3,10),1) <br />
AND REF(ZIG(3,10),1)&gt;REF(ZIG(3,10),2); <br />
VAR2:=ZIG(3,10)&gt;REF(ZIG(3,10),1) <br />
AND REF(ZIG(3,10),1)&lt;REF(ZIG(3,10),2);<br />
STICKLINE(VAR1,C,O,8,0),COLORYELLOW,LINETHICK2;<br />
STICKLINE(VAR1,C,O,3,0),COLORYELLOW,LINETHICK2;<br />
STICKLINE(VAR1,H,L,1,0),COLORYELLOW,LINETHICK2;<br />
STICKLINE(VAR2,C,O,8,0),COLORFF00FF,LINETHICK2;<br />
STICKLINE(VAR2,C,O,3,0),COLORFF00FF,LINETHICK2;<br />
STICKLINE(VAR2,H,L,1,0),COLORFF00FF,LINETHICK2;<br />
DRAWTEXT(TROUGHBARS(3,15,1)&lt;1,LOW,'&rarr;买入') , COLORRED,LINETHICK1;<br />
DRAWTEXT(CROSS(REF(ZIG(3,10),1),ZIG(3,10)),HIGH*1.001,'&rarr;走人') , COLORGREEN,LINETHICK1;<br />
DRAWICON(CROSS(ZIG(3,10) ,REF(ZIG(3 ,10),1)) ,LOW*0.99,6);{<br />
DRAWICON(CROSS(REF(ZIG(3,10),1),ZIG(3,10)) ,HIGH*1.02,7);};</p>
<p></p>
<p>&nbsp;</p>
页: [1]
查看完整版本: 飞狐自动百分箱体主图指标公式