N1:=斜线周期;
M:=INTPART(3*N1/8);
A12:=REF(NOTEXT113,M)=HHV(NOTEXT113,2*M+1);
B12:=FILTER(A12,M);
C12:=BACKSET(B12,M+1);
D12:=FILTER(C12,M);
R112:=BACKSET(ISLASTBAR,BARSLAST(D12)+1);
S112:=R112>REF(R112,1);
GLC:=DRAWLINE(D12,NOTEXT113,S112,NOTEXT113,1);
NOTEXT123:IF(CONST(REF(GLC,3))>CONST(REF(GLC,1)) AND CONST(两强条件),GLC,DRAWNULL),COLORCYAN,DOTLINE;
SJ:=CONST(BARSLAST(S112));
DRAWTEXT(CURRBARSCOUNT=SJ AND NOTEXT123!=DRAWNULL,NOTEXT123,'短'),COLORCYAN,DRAWABOVE;
SYX:=(H-MAX(O,C))/MAX(O,C)*100;
DRAWICON(FILTERX(CROSS(NOTEXT113,NOTEXT123),120) AND CURRBARSCOUNT<=INTPART(SJ*2/3) AND SYX<3 AND C>REF(C,1) AND C>O AND 两强条件,NOTEXT123*0.98,28);
公式源码:}
DRAWGBK(CLOSE>1,RGB(0,0,0),RGB(1,1,1),1,0,0);
X_1:=(CLOSE-REF(CLOSE,1))/REF(CLOSE,1)*100;
X_2:=IF(CODELIKE(1),DRAWNULL,SUM(X_1,累加周期));
X_3:=HY_INDEXC;
X_4:=(X_3-REF(X_3,1))/REF(X_3,1)*100;
X_5:=SUM(X_4,累加周期);
X_6:=IF(CODELIKE(2) OR CODELIKE(3) OR CODELIKE(1),"999999$CLOSE","399001$CLOSE");
X_7:=(X_6-REF(X_6,1))/REF(X_6,1)*100;
X_8:=SUM(X_7,累加周期);
NOTEXT114:CONST(HHV(X_2,累加周期))*IF(CONST(HHV(X_2,累加周期))<0,0.8,1.13),COLORBLACK;
X_9:=(X_2-X_5)/ABS(X_5)*100;
X_10:=X_2>X_8 AND X_9>0;
NOTEXT120:CONST(MAX(CONST(HHV(X_8,21)),MAX(CONST(HHV(X_5,21)),CONST(HHV(X_2,21)))))*1.2,COLORBLACK;
DRAWGBK(IF(CODELIKE(1) OR CODELIKE(4),DRAWNULL,NOT(X_10) AND ISLASTBAR),RGB(0,0,0),RGB(0,120,0),1,0,0);
DRAWGBK(IF(CODELIKE(1) OR CODELIKE(4),DRAWNULL,X_10 AND ISLASTBAR),RGB(0,0,0),RGB(255,128,0),1,0,0);
DRAWGBK(IF(CODELIKE(1) OR CODELIKE(4),DRAWNULL,X_2<X_8 AND ISLASTBAR AND CODELIKE(3)),RGB(0,0,0),RGB(0,120,0),1,0,0);
DRAWGBK(IF(CODELIKE(1) OR CODELIKE(4),DRAWNULL,X_2>X_8 AND ISLASTBAR AND CODELIKE(3)),RGB(0,0,0),RGB(255,128,0),1,0,0);
NOTEXT110:X_8,COLORRED,LINETHICK2;
NOTEXT116:X_5,COLORYELLOW;
DRAWTEXT(ISLASTBAR,NOTEXT110,IF(CODELIKE(2) OR CODELIKE(3) OR CODELIKE(1),5,6)),COLORRED;
DRAWTEXT(ISLASTBAR,NOTEXT116,STRCAT(7,HYBLOCK)),COLORYELLOW;
NOTEXT113:X_2,COLORWHITE;
DRAWTEXT(ISLASTBAR,X_2,IF(CODELIKE(3),STRCAT(7,STRCAT(STKNAME,8)),STRCAT(7,STKNAME))),COLORWHITE;
X_11:=ZIG(X_2,前高ZIG);
X_12:=CONST(SUMBARS(X_11<REF(X_11,1) AND REF(X_11,1)>REF(X_11,2),1));
X_13:=CONST(SUMBARS(X_11<REF(X_11,1) AND REF(X_11,1)>REF(X_11,2),2));
X_14:=IF(X_12=0,X_13,X_12);
X_15:=CONST(REF(X_11,X_14));
NOTEXT1133:IF(CURRBARSCOUNT<=X_14+1,X_15,DRAWNULL),DOTLINE,COLORGREEN;
DRAWTEXT_FIX(X_10 AND ISLASTBAR,0.284,0,0,9),COLORRED;
DRAWTEXT_FIX(X_10 AND ISLASTBAR,0.281,0,0,10),COLORYELLOW;
DRAWTEXT_FIX(NOT(X_10) AND ISLASTBAR,0.284,0,0,9),COLORGREEN;
DRAWTEXT_FIX(NOT(X_10) AND ISLASTBAR,0.281,0,0,11),COLORBLACK;
DRAWTEXT_FIX(X_5>X_8 AND ISLASTBAR,0.53,0,0,12),COLORRED;
DRAWTEXT_FIX(X_5>X_8 AND ISLASTBAR,0.53,0,0,STRCAT(STRCAT(13,HYBLOCK),14)),COLORYELLOW;
DRAWTEXT_FIX(X_5<X_8 AND ISLASTBAR,0.53,0,0,12),COLORGREEN;
DRAWTEXT_FIX(X_5<X_8 AND ISLASTBAR,0.53,0,0,STRCAT(STRCAT(15,HYBLOCK),14)),COLORBLACK;
X_16:=CROSS(X_2,X_5) AND X_2>X_8 AND X_2>REF(X_2,1);
X_17:=CROSS(X_2,X_8) AND X_2>X_5 AND X_2>REF(X_2,1);
X_18:=CROSS(X_2,X_5) AND CROSS(X_2,X_8) AND X_2>REF(X_2,1);
DRAWICON(X_16 OR X_17 OR X_18,MAX(X_5,X_8)*IF(MAX(X_5,X_8)>0,0.8,1.1),9);
DRAWICON(CROSS(X_2,NOTEXT1133),NOTEXT1133*IF(NOTEXT1133>0,0.95,1.1),30);
DRAWICON(FILTER(CROSS(X_2,X_8),13) AND CODELIKE(3),X_8*IF(X_8>0,0.95,1.5),29);
DRAWICON(FILTER(CROSS(X_8,X_2),13) AND CODELIKE(3),X_8*IF(X_8>0,1.06,0.5),15);
X_19:=STRCAT(16,VAR2STR(累加周期,0));
X_20:=STRCAT(X_19,17);
X_21:=STRCAT(X_20,18);
DRAWTEXT_FIX(1,0,0,0,X_21),COLORWHITE;
DRAWTEXT_FIX(1,0.02,0.19,0,19),COLORRED; |