文华财经波谷波峰支撑压力画线主图指标源码:
EM01:=EMA(C,10);
EM:=EMA(C,21);
UP1:=EMA(EM,13);
DOWN:=EMA(EM,17);
MIDD:=(UP1+DOWN)/2,POINTDOT;
止盈线:EMA(EMA(C,10),10),COLORRED,LINETHICK1;
空止盈:=止盈线>REF(止盈线,1);
IF(空止盈-1,止盈线,NULL),COLORCYAN,LINETHICK1;
//
VAR1:=MA(CLOSE,0);
FF:=VAR1>REF(VAR1,1);
STICKLINE1(C>VAR1,H,L,0,1),COLORRED;
STICKLINE(C>VAR1,C,O,9,1),COLORRED;
STICKLINE1(C<VAR1,H,L,0,1),COLORLIGHTGREEN;
STICKLINE(C<VAR1,C,O,9,1),COLORLIGHTGREEN;
STICKLINE(CLOSE>REF(CLOSE,1)*1.0985 AND CLOSE=HIGH,CLOSE,OPEN,9.5,0), COLORMAGENTA;
STICKLINE(CLOSE<REF(CLOSE,1)*0.9015 AND CLOSE=LOW,CLOSE,OPEN,9.5,0), COLORLIGHTGREEN;
VAR2:= CROSS(C,VAR1);
VAR3:= CROSS(VAR1,C);
STICKLINE(VAR2,C,O,9.5,0),COLORMAGENTA;
STICKLINE(VAR3,C,O,9.5,0),COLORBLUE;
DRAWCOLORLINE(FF,VAR1,RGB(255,0,0),RGB(0,255,0)),LINETHICK3;
BDGD:=CROSS(0.8,H=HHV(H,6));
GDSJ:=BARSLAST(BDGD)+1;
波峰:=REF(H,GDSJ),COLOR1EFF1E;
BDDD:=CROSS(0.8,L=LLV(L,6));
DDSJ:=BARSLAST(BDDD)+1;
波谷:=REF(L,DDSJ),COLOR7400E8;
DRAWSL(GDSJ<=8&&空止盈=0,波峰,0,1,0,COLORGREEN),LINETHICK3;
DRAWSL(DDSJ<=8&&空止盈,波谷,0,1,0,COLORLIGHTRED),LINETHICK3;
DRAWSL(GDSJ<=8&&空止盈=0,波峰,0,-1,0,COLORGREEN),LINETHICK3;
DRAWSL(DDSJ<=8&&空止盈,波谷,0,-1,0,COLORLIGHTRED),LINETHICK3;
DRAWNUMBER((CROSSDOWN(GDSJ<=8,0.5)||(GDSJ<=8&&波峰<>REF(波峰,1)&&NOT(CROSS(GDSJ<=8,0.5)))||ISLASTBAR&&GDSJ<=8)&&空止盈=0,REF(波峰,1),REF(波峰,1),0,COLORBLUE),FONTSIZE20;
DRAWNUMBER((CROSSDOWN(DDSJ<=8,0.5)||(DDSJ<=8&&波谷<>REF(波谷,1)&&NOT(CROSS(DDSJ<=8,0.5)))||ISLASTBAR&&DDSJ<=8)&&空止盈,REF(波谷,1),REF(波谷,1),0,COLORLIGHTRED),FONTSIZE20;
KTEXT((波峰<>REF(波峰,1)||CROSS(GDSJ<=8,0.5))&&空止盈=0,0,波峰,1,COLORGREEN,’▼’),FONTSIZE30;
KTEXT((波谷<>REF(波谷,1)||CROSS(DDSJ<=8,0.5))&&空止盈,0,波谷,1,COLORLIGHTRED,’▲’),FONTSIZE30,VALIGN0;