通达信自用沧海桑田指标副图,源码
自用指标[沧海桑田]{原系统指标[主力买卖]}
{沧海桑田}
R1:=SMA(MAX(C-REF(C,1),0),12,1)/SMA(ABS(C-REF(C,1)),12,1)*100;
R2:=SMA(MAX(C-REF(C,1),0),18,1)/SMA(ABS(C-REF(C,1)),18,1)*100;
快线:MA(3*R1-2*SMA(MAX(C-REF(C,1),0),16,1)/SMA(ABS(C-REF(C,1)),16,1)*100,3),COLORWHITE;
慢线:EMA(快线,8),COLORYELLOW;
沧海桑田:MA(3*R2-2*SMA(MAX(C-REF(C,1),0),12,1)/SMA(ABS(C-REF(C,1)),12,1)*100,5),COLORMAGENTA;
ZFT:(快线-慢线)*2,COLORSTICK,NODRAW;
建增补仓:IF((快线<20),20,10),COLORLIMAGENTA,LINETHICK2;
警惕:IF((快线>80),80,90),LINETHICK2,COLORCYAN;
RS1:="RSI.RSI1">="RSI.RSI2" AND "RSI.RSI2">="RSI.RSI3";
RS2:="RSI.RSI1"<"RSI.RSI2" AND "RSI.RSI2"<"RSI.RSI3";
RS3:=NOT("RSI.RSI1">="RSI.RSI2" AND "RSI.RSI2">="RSI.RSI3")AND NOT("RSI.RSI1"<"RSI.RSI2" AND "RSI.RSI2"<"RSI.RSI3");
NOTEXT1:IF(RS1,82,DRAWNULL),CIRCLEDOT,COLORRED,LINETHICK1;
NOTEXT2:IF(RS2,82,DRAWNULL),CIRCLEDOT,COLORGREEN,LINETHICK1;
NOTEXT3:IF(RS3,82,DRAWNULL),CROSSDOT,LINETHICK6,COLORMAGENTA;
NOTEXT4:IF(RS3,82,DRAWNULL),POINTDOT,LINETHICK4,COLOR00CCFF;
DRAWTEXT(ISLASTBAR,84,' 富贵花开'),COLOR007A7A;
STICKLINE(ZFT>=0 AND ZFT>=REF(ZFT,1),50,50+ZFT,2.3,0),COLORLIMAGENTA;
STICKLINE(ZFT>=0 AND ZFT<=REF(ZFT,1),50,50+ZFT,2.3,1),COLORLIMAGENTA;
STICKLINE(ZFT<=0 AND ZFT>=REF(ZFT,1),50,50+ZFT,2.3,0),COLORLIGREEN;
STICKLINE(ZFT<=0 AND ZFT<=REF(ZFT,1),50,50+ZFT,2.3,1),COLORLIGREEN;
DRAWBAND(快线,RGB(250,250,250),快线,RGB(250,250,250));
DRAWBAND(慢线,RGB(250,250,0),慢线,RGB(250,250,0));
DRAWBAND(沧海桑田,RGB(250,0,250),沧海桑田,RGB(250,0,250));
11788485.jpg
|