通达信成本均线主图,加入大量顶底背离
本人组合了一下,请大家注意K线下的小原点,谢谢!源码如下:
{N 1 100 30 M 1 100 95 }
获利盘:WINNER(CLOSE)*100,NODRAW,COLORRED;
KDJ_K:="KDJ.K"(9,3,3);KDJ_D:="KDJ.D"(9,3,3);KDJ_J:="KDJ.J"(9,3,3);
买1:=CROSS(KDJ_J,0) OR (CROSS(KDJ_J,KDJ_K) AND KDJ_D<26);
买2:=CROSS("RSI.RSI1"(6,2,2),20) OR CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));
买3:=CROSS("MACD.DIF","MACD.DEA") OR CROSS("MACD.MACD",0);
买0:=买1+买2+买3;
买:=IF(买0>1,买0,0);
掏底:IF(买,L*0.9978-0.03,DRAWNULL),POINTDOT,COLOR00FFFF,LINETHICK5;
选股:=FILTER(CROSS("KDJ.K","KDJ.D")&&CROSS("MACD.DIF","MACD.DEA"),50);
低吸:IF(选股,L*0.988-0.01,DRAWNULL),POINTDOT,COLORFF00FF,LINETHICK7;
1:MA(C,1);
V1:EMA(CLOSE,5),COLORYELLOW;
V2:EMA(EMA(CLOSE,29)*1.01,10),COLORFFCC66;
DRAWICON(CROSS(V1,V2),V2,1);
V3:EMA(CLOSE,10),COLORFF00FF;
V4:EMA(EMA(CLOSE,60)*0.99,10),COLOR0099FF;
DRAWICON(CROSS(V3,V4),V4,1);
VAR1:=AMOUNT/VOL/100;
庄家运作成本: MA(CLOSE,18),COLORWHITE;
庄家平均成本: EMA(EMA(VAR1,2),N),COLOR00FF00;
庄家底仓成本: EMA(EMA(VAR1,13),M),COLORBLUE;
无穷成本均线: DMA(CLOSE,VOL/CAPITAL),COLORBLUE;
STICKLINE(C>=O,C,O,3,0),COLORRED;
STICKLINE(C>=O,C,O,2,0),COLOR7070FF{B0B0FF};
STICKLINE(C>=O,C,O,1,0),COLORYELLOW;
STICKLINE(C>=O,H,L,0,0),COLORYELLOW;
STICKLINE(C<=O,C,O,3,0),COLORFF2020;
STICKLINE(C<=O,C,O,2,0),COLORFF6600;
STICKLINE(C<=O,C,O,1,0),{COLORCYAN;}COLORFFCC66;
STICKLINE(C<=O,H,L,0,0),{COLORCYAN}COLORFFCC66;
VAR326:=IF(CLOSE>REF(CLOSE,1),88,0);
VAR327:=IF(CLOSE/REF(CLOSE,1)>1.050 AND HIGH/CLOSE<1.010 AND VAR326>0, 91, 0);
STICKLINE(VAR327>90,L*0.99,L*0.95,2,0),COLORBF20FF;
DRAWTEXT(VAR327>90,LOW*0.95,'追涨'),COLORBF20FF;
上开:=O;
上收:=C;
上高:=H;
上低:=L;
VAR11:=(上收-LLV(上低,27))/(HHV(上高,27)-LLV(上低,27))*100;
VAR12:=SMA(VAR11,3,1);
VAR13:=SMA(VAR12,3,1);
VAR14:=SMA(VAR13,3,1);
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA);
DRAWICON(FILTER(B1>0,5),L*0.94,10);
DRAWTEXT(FILTER(B1>0,5),L*0.94,'M底'),COLORGREEN;{MACD底背离}
A2:=BARSLAST(REF(CROSS("KDJ.K","KDJ.D"),1));
B2:=REF(C,A2+1)>C AND REF("KDJ.K",A2+1)<"KDJ.K" AND CROSS("KDJ.K","KDJ.D");
DRAWICON(FILTER(B2>0,5),L*0.96,10);
DRAWTEXT(FILTER(B2>0,5),L*0.96,'K底'),COLORYELLOW;{KDJ底背离}
C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));
D1:=REF(C,C1+1)<C AND REF(DIFF,C1+1)>DIFF AND CROSS(DEA,DIFF);
DRAWICON(FILTER(D1>0,5),H*1.07,12);
DRAWTEXT(FILTER(D1>0,5),H*1.07,'M顶'),COLOR0066FF;{MACD顶背离}
C2:=BARSLAST(REF(CROSS("KDJ.D","KDJ.K"),1));
D2:=REF(C,C2+1)<C AND REF("KDJ.K",C2+1)>"KDJ.K" AND CROSS("KDJ.D","KDJ.K");
DRAWICON(FILTER(D2>0,5),H*1.05,12);
DRAWTEXT(FILTER(D2>0,5),H*1.05,'K顶'),COLORRED;{KDJ顶背离}
C3:=BARSLAST(REF(CROSS("RSI.RSI2","RSI.RSI1"),1));
D3:=REF(C,C3+1)<C AND REF("RSI.RSI1",C3+1)>"RSI.RSI1" AND CROSS("RSI.RSI2","RSI.RSI1");
DRAWICON(FILTER(D3>0,5),H*1.03,12),;
DRAWTEXT(FILTER(D3>0,5),H*1.03,'R顶'),COLORMAGENTA,;{RSI顶背离};
ST:="MCST";
QQ:=FILTER(C>ST,22);
IF(QQ,L*0.998-0.01,DRAWNULL),POINTDOT,LINETHICK5,COLORRED;
IF(QQ,L*0.998-0.04,DRAWNULL),POINTDOT,LINETHICK5,COLOR55FF33;
IF(QQ,L*0.998-0.07,DRAWNULL),POINTDOT,LINETHICK5,COLORFF00FF;
{RSI底背}
A3:=BARSLAST(REF(CROSS("RSI.RSI1","RSI.RSI2"),1));
B3:=REF(C,A3+1)>C AND REF("RSI.RSI1",A3+1)<"RSI.RSI1" AND CROSS("RSI.RSI1","RSI.RSI2");
IF(B3,L*0.9978-0.05,DRAWNULL),POINTDOT,COLORCYAN,LINETHICK5;