主图指标源码:
VAR1:=EMA(C,2);
VAR2:=EMA(SLOPE(C,21)*20+C,42);
VAR3:=CROSS(VAR1,VAR2);
VAR4:=CROSS(VAR2,VAR1);
VAR5:MA(C,20),COLORGREEN,LINETHICK1;
CAR6:MA(C,10),COLORCYAN,LINETHICK1;
DRAWTEXT(VAR3,LOW*0.95,'买'),COLORYELLOW,LINETHICK3;
DRAWTEXT(VAR4,HIGH*1.028,'卖'),COLORGREEN,LINETHICK3;
STICKLINE(VAR1=VAR2,LOW,HIGH,0,0),COLORRED;
STICKLINE(VAR1>=VAR2,CLOSE,OPEN,2,0),COLORRED;
STICKLINE(VAR1>=VAR2,CLOSE,OPEN,2,0),COLORRED;
STICKLINE(VAR1>=VAR2,CLOSE,OPEN,2,0),COLORRED;
STICKLINE(VAR1>=VAR2,CLOSE,OPEN,2,0),COLORRED;
STICKLINE(VAR1<VAR2,CLOSE,OPEN,2,0),COLORGREEN;
STICKLINE(VAR1<VAR2,CLOSE,OPEN,2,0),COLORGREEN;
STICKLINE(VAR1<VAR2,CLOSE,OPEN,2,0),COLORGREEN;
STICKLINE(VAR1<VAR2,CLOSE,OPEN,2,0),COLORGREEN;
STICKLINE(VAR1<VAR2,LOW,HIGH,0,0),COLORGREEN;
附图指标源码:
DING:=MAX(O,C);{实顶}
DI:=MIN(O,C);{实底}
YANG:=(DI>=REF(DING,1)) OR (C>O AND NOT(DING<=REF(DI,1))) OR (C>REF(C,1) AND C=O) OR (C=REF(C,1) AND C=O AND REF(DING,1)=C);{阳线}
YIN:=NOT(YANG);
{YIN:=(C<O AND NOT(DI>=REF(DING,1))) OR (C>O AND DING<=REF(DI,1)) OR (C<REF(C,1) AND C=O) OR (C=REF(C,1) AND C=O AND REF(DI,1)=C);{阴线}}
YANGSHENG:YANG AND C>=REF(DING,BARSLAST(YIN)) AND (V>REF(V,BARSLAST(YIN)) OR (BETWEEN(V,REF(V,BARSLAST(YIN))*0.95,REF(V,BARSLAST(YIN))*1.05))),NODRAW;
DRAWTEXT(YANGSHENG AND REF(NOT(YANGSHENG),1),L*0.99,'△'),COLORRED;
DRAWTEXT(YANGSHENG AND REF(NOT(YANGSHENG),1) AND V<REF(V,1)*1.5,L*0.99,'▲'),COLORRED;
YINSHENG:=(YIN AND C<=REF(DI,BARSLAST(YANG)) AND V>REF(V,BARSLAST(YANG)));
DRAWTEXT(YINSHENG AND REF(NOT(YINSHENG),1),H*1.02,'▽'),COLORGREEN;
LIANGJIABI:V/C,NODRAW;
MALIANGJIABI:MA(LIANGJIABI,3),NODRAW;
LIANGJIABIXISHU:=1.5;
BLZ:=V>REF(V,1)*1.5;
PLZ:=BETWEEN(V,REF(V,1)*0.95,REF(V,1)*1.05) OR BETWEEN(V,REFX(V,1)*0.95,REFX(V,1)*1.05) OR
(BETWEEN(V,REF(V,2)*0.95,REF(V,2)*1.05) AND V>REF(V,1)*1.2) OR
(BETWEEN(V,REF(V,3)*0.95,REF(V,3)*1.05) AND V>REF(MA(V,2),1)*1.2 AND V>REF(HHV(V,2),1)) OR
(BETWEEN(V,REF(V,4)*0.95,REF(V,4)*1.05) AND V>REF(MA(V,3),1)*1.2 AND V>REF(HHV(V,3),1)) OR
(BETWEEN(V,REF(V,5)*0.95,REF(V,5)*1.05) AND V>REF(MA(V,4),1)*1.2 AND V>REF(HHV(V,4),1)) OR
(BETWEEN(V,REF(V,6)*0.95,REF(V,6)*1.05) AND V>REF(MA(V,5),1)*1.2 AND V>REF(HHV(V,5),1)) OR
(BETWEEN(V,REF(V,7)*0.95,REF(V,7)*1.05) AND V>REF(MA(V,6),1)*1.2 AND V>REF(HHV(V,6),1)) OR
(BETWEEN(V,REF(V,8)*0.95,REF(V,8)*1.05) AND V>REF(MA(V,7),1)*1.2 AND V>REF(HHV(V,7),1)) OR
(BETWEEN(V,REF(V,9)*0.95,REF(V,9)*1.05) AND V>REF(MA(V,8),1)*1.2 AND V>REF(HHV(V,8),1)) OR
(BETWEEN(V,REF(V,10)*0.95,REF(V,10)*1.05) AND V>REF(MA(V,9),1)*1.2 AND V>REF(HHV(V,9),1)) OR
(BETWEEN(V,REF(V,11)*0.95,REF(V,11)*1.05) AND V>REF(MA(V,10),1)*1.2 AND V>REF(HHV(V,10),1)) OR
(BETWEEN(V,REF(V,12)*0.95,REF(V,12)*1.05) AND V>REF(MA(V,11),1)*1.2 AND V>REF(HHV(V,11),1));
GLZ:=V=HHV(V,3) AND V=REFX(HHV(V,3),2);
TLZ:=(V*1.1<REFX(V,1) AND REFX(V,1)*1.1<REFX(V,2)) OR (V>REF(V,1)*1.1 AND V*1.1<REFX(V,1)) OR (V>REF(V,1)*1.1 AND REF(V,1)>REF(V,2)*1.1);
JSLS:=C<=REFX(C,1) AND REFX(C,1)<=REFX(C,2) AND LIANGJIABI>REFX(LIANGJIABI,1) AND REFX(LIANGJIABI,1)>REFX(LIANGJIABI,2);
JZ:=BLZ OR GLZ OR PLZ OR TLZ,NODRAW;
JJZ:=CURRBARSCOUNT>=4 AND YANG AND (YANGSHENG) AND JZ AND REFX(LLV(DI,3),3)>=DI AND (REFX(MA(LIANGJIABI,3),3)<=LIANGJIABIXISHU*LIANGJIABI OR REFX(JSLS,1)) AND REFX(C,3)>=DING,NODRAW;
HJZ1:=JJZ AND REFX(MA(C,3),3)>=DING AND REFX(MA(LIANGJIABI,3),3)<=LIANGJIABI AND REFX(YANG,3);
HJZ2:=YANG AND YANGSHENG AND JZ AND REFX(DI,1)>=DI AND REFX(JJZ,2) AND REFX(C,2)>DING AND REFX(LIANGJIABI,1)<LIANGJIABI;
HJZ3:=YANG AND YANGSHENG AND JZ AND REFX(LLV(DI,2),2)>=DI AND REFX(JJZ,3) AND REFX(C,3)>DING AND REFX(MA(LIANGJIABI,2),2)<LIANGJIABI;
HJZ4:=JJZ AND REFX(LLV(DI,3),3)>=DING AND REFX(MA(LIANGJIABI,3),3)<=LIANGJIABI AND REFX(YANG,3) AND (REFX(YANG,1) OR REFX(YANG,2));
WP:JJZ OR HJZ1 OR HJZ4 OR HJZ2 OR HJZ3,NODRAW;
CONDJJZ:=JJZ AND REF(NOT(WP),1);
CONDHJZ1:=(HJZ1 OR HJZ2 OR HJZ3) AND REF(NOT(WP),1);
STICKLINE(CONDJJZ,C,O,1,0),COLORYELLOW;
STICKLINE(CONDHJZ1,C,O,1,0),COLORMAGENTA;
DRAWTEXT(HJZ4 AND REF(NOT(HJZ4),1),L*0.98,'H'),COLORRED;
DRAWLINE(CONDJJZ,DING,REF(CONDJJZ,1),REF(DING,1),1),COLORBROWN;
DRAWLINE(CONDJJZ,DI,REF(CONDJJZ,1),REF(DI,1),1),COLORBROWN;
DRAWLINE(CONDHJZ1,DING,REF(CONDHJZ1,1),REF(DING,1),1),COLORBROWN;
DRAWLINE(CONDHJZ1,DI,REF(CONDHJZ1,1),REF(DI,1),1),COLORBROWN;
Z:=CONDJJZ OR CONDHJZ1;
PZ:=REF(C,BARSLAST(Z));
SHENG:=IF(Z AND C>REF(PZ,1),1,DRAWNULL);
P1DI:=REF(DI,1);
P1L:=REF(L,1);
P2DI:=REF(DI,2);
P2L:=REF(L,2);
P3DI:=REF(DI,3);
P3L:=REF(L,3);
P4DI:=REF(DI,4);
P4L:=REF(L,4);
P5DI:=REF(DI,5);
P5L:=REF(L,5);
P6DI:=REF(DI,6);
P6L:=REF(L,6);
P7DI:=REF(DI,7);
P7L:=REF(L,7);
P8DI:=REF(DI,8);
P8L:=REF(L,8);
P9DI:=REF(DI,9);
P9L:=REF(L,9);
P10DI:=REF(DI,10);
P10L:=REF(L,10);
P11DI:=REF(DI,11);
P11L:=REF(L,11);
P12DI:=REF(DI,12);
P12L:=REF(L,12);
P13DI:=REF(DI,13);
P13L:=REF(L,13);
P14DI:=REF(DI,14);
P14L:=REF(L,14);
P15DI:=REF(DI,15);
P15L:=REF(L,15);
P16DI:=REF(DI,16);
P16L:=REF(L,16);
P17DI:=REF(DI,17);
P17L:=REF(L,17);
P18DI:=REF(DI,18);
P18L:=REF(L,18);
P19DI:=REF(DI,19);
P19L:=REF(L,19);
P20DI:=REF(DI,20);
P20L:=REF(L,20);
JZX1:=ABS(DI-P1DI)<=0.01 OR ABS(DI-P2DI)<=0.01 OR ABS(DI-P3DI)<=0.01 OR ABS(DI-P4DI)<=0.01 OR ABS(DI-P5DI)<=0.01 OR ABS(DI-P6DI)<=0.01 OR ABS(DI-P7DI)<=0.01 OR ABS(DI-P8DI)<=0.01 OR ABS(DI-P9DI)<=0.01 OR ABS(DI-P10DI)<=0.01 OR
ABS(DI-P11DI)<=0.01 OR ABS(DI-P12DI)<=0.01 OR ABS(DI-P13DI)<=0.01 OR ABS(DI-P14DI)<=0.01 OR ABS(DI-P15DI)<=0.01 OR ABS(DI-P16DI)<=0.01 OR ABS(DI-P17DI)<=0.01 OR ABS(DI-P18DI)<=0.01 OR ABS(DI-P19DI)<=0.01 OR ABS(DI-P20DI)<=0.01;
JZX2:=ABS(DI-P1L)<=0.01 OR ABS(DI-P2L)<=0.01 OR ABS(DI-P3L)<=0.01 OR ABS(DI-P4L)<=0.01 OR ABS(DI-P5L)<=0.01 OR ABS(DI-P6L)<=0.01 OR ABS(DI-P7L)<=0.01 OR ABS(DI-P8L)<=0.01 OR ABS(DI-P9L)<=0.01 OR ABS(DI-P10L)<=0.01 OR
ABS(DI-P11L)<=0.01 OR ABS(DI-P12L)<=0.01 OR ABS(DI-P13L)<=0.01 OR ABS(DI-P14L)<=0.01 OR ABS(DI-P15L)<=0.01 OR ABS(DI-P16L)<=0.01 OR ABS(DI-P17L)<=0.01 OR ABS(DI-P18L)<=0.01 OR ABS(DI-P19L)<=0.01 OR ABS(DI-P20L)<=0.01;
JZX3:=ABS(L-P1DI)<=0.01 OR ABS(L-P2DI)<=0.01 OR ABS(L-P3DI)<=0.01 OR ABS(L-P4DI)<=0.01 OR ABS(L-P5DI)<=0.01 OR ABS(L-P6DI)<=0.01 OR ABS(L-P7DI)<=0.01 OR ABS(L-P8DI)<=0.01 OR ABS(L-P9DI)<=0.01 OR ABS(L-P10DI)<=0.01 OR
ABS(L-P11DI)<=0.01 OR ABS(L-P12DI)<=0.01 OR ABS(L-P13DI)<=0.01 OR ABS(L-P14DI)<=0.01 OR ABS(L-P15DI)<=0.01 OR ABS(L-P16DI)<=0.01 OR ABS(L-P17DI)<=0.01 OR ABS(L-P18DI)<=0.01 OR ABS(L-P19DI)<=0.01 OR ABS(L-P20DI)<=0.01;
JZX4:=ABS(L-P1L)<=0.01 OR ABS(L-P2L)<=0.01 OR ABS(L-P3L)<=0.01 OR ABS(L-P4L)<=0.01 OR ABS(L-P5L)<=0.01 OR ABS(L-P6L)<=0.01 OR ABS(L-P7L)<=0.01 OR ABS(L-P8L)<=0.01 OR ABS(L-P9L)<=0.01 OR ABS(L-P10L)<=0.01 OR
ABS(L-P11L)<=0.01 OR ABS(L-P12L)<=0.01 OR ABS(L-P13L)<=0.01 OR ABS(L-P14L)<=0.01 OR ABS(L-P15L)<=0.01 OR ABS(L-P16L)<=0.01 OR ABS(L-P17L)<=0.01 OR ABS(L-P18L) |