文化财经 盘立方 同花顺期货通瀑布线多空止损止盈主图指标源码:
M1:=4;
M3:=9;
M6:=24;
PB1:(EMA(CLOSE,M1)+MA(CLOSE,M1*2)+MA(CLOSE,M1*4))/3;
PB3:(EMA(CLOSE,M3)+MA(CLOSE,M3*2)+MA(CLOSE,M3*4))/3;
PB6:(EMA(CLOSE,M6)+MA(CLOSE,M6*2)+MA(CLOSE,M6*4))/3; //定义6条瀑布线
DIFF := EMA(CLOSE,12) – EMA(CLOSE,26);
DEA := EMA(DIFF,9);
MACD:=2*(DIFF-DEA),COLORSTICK;
DD:=CROSS(PB1>PB3&&PB3>PB6&&ISUP&&C>PB1,0.5);
PD:C<MIN1(PB1,PB3,PB6),NODRAW;
KK:=CROSS(PB6>PB3&&PB3>PB1&&ISDOWN&&C<PB1,0.5);
PK:C>MAX1(PB1,PB3,PB6),NODRAW;
PD&&COUNT(PD,BARSLAST(DD)+1)=1,WORD(1,’多止损’);
DD&&COUNT(DD,BARSLAST(PD)+1)=1,WORD(1,’多’);
PK&&COUNT(PK,BARSLAST(KK)+1)=1,WORD(1,’空止损’);
KK&&COUNT(KK,BARSLAST(PK)+1)=1,WORD(1,’空’);
DRAWCOLORKLINE( BARSLAST(DD&&COUNT(DD,BARSLAST(PD)+1)=1)<BARSLAST(PD&&COUNT(PD,BARSLAST(DD)+1)=1),COLORRED,0);
DRAWCOLORKLINE(BARSLAST(KK&&COUNT(KK,BARSLAST(PK)+1)=1)<BARSLAST(PK&&COUNT(PK,BARSLAST(KK)+1)=1),COLORGREEN,0);