M3:MA(C,3);
M5:=MA(C,5);
M8:=MA(C,8);
M11:MA(C,11);
M16:=MA(C,16);
M32:=MA(C,32);
M55:MA(C,55);
M89:MA(C,89);
M144:MA(C,144);
M233:MA(C,233);
M512:MA(C,512);
M1024:=MA(C,1024);
月价托:m5>m16 and m5>m8 and cross(m8,m16),coloryellow,linethick0;
季价托:m16>m55 and m16>m32 and cross(m32,m55),colorf00ff0,linethick0;
短、长价托:m5>m55 and m5>m8 and cross(m8,m55),colorred,linethick0;
drawtext(月价托,l,'月价托'),coloryellow;
stickline(月价托,l,h,0.5,1), coloryellow;
stickline(月价托,o,c,5,1),linethick3, coloryellow;
drawtext(季价托,l,'季价托'),colorf00ff0;
stickline(季价托,l,h,0.5,1), colorf00ff0;
stickline(季价托,o,c,5,1),linethick3, colorf00ff0;
drawtext(短、长价托,l,'短、长价托'),color36c0c1;
stickline(短、长价托,l,h,0.5,1), color36c0c1;
stickline(短、长价托,o,c,5,0),linethick3, color36c0c1;
vol1:=MA(VOL,5);
vol2:=MA(VOL,10);
vol3:=MA(VOL,20);
量托:vol1>=vol3 and cross(vol2,vol3) and ref(vol2,1)<ref(vol3,1),linethick0;
drawtext(量托,l,'▲'),colorwhite;
drawtext(量托,l*0.97,'量托'),colorwhite;
stickline(量托,l,h,0.5,1), colorwhite;
stickline(量托,o,c,5,1),linethick3, colorwhite;
DRAWTEXTREL(4,20,'板块:'+BKNAME),LINETHICK1,COLORFFFFFF;
DRAWTEXTABS(4,20 ,'流通盘:'+capital/1000000+'亿(小盘股<5个亿<中盘股<10亿<大盘股)'),COLOR00FF00,linethick1;
BDGD:=C=HHV(C,13);
GDSJ:=BARSLAST(FILTER(CROSS(0.8,BDGD),2))+1;
高点:REF(C,GDSJ),COLORFF00FF,POINTDOT,LAYER0;
突破:CROSS(C,REF(高点,1)),COLOR00FFFF,POINTDOT,LINETHICK0;
STICKLINE(GDSJ<=6,高点,高点,8,0),COLORFF00FF,LAYER0;
DRAWTEXT(突破,LOW,'↑'),COLOR00FFFF,ALIGN1;
BDDD:=C=LLV(C,13);
DDSJ:=BARSLAST(FILTER(CROSS(0.8,BDDD),2))+1;
低点:REF(C,DDSJ),COLOR00FF00,POINTDOT,LAYER0;
STICKLINE(DDSJ<=6,低点,低点,8,0),COLOR00FF00,LAYER0;
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);
DRAWTEXT(FILTER(B1>0,5),L*0.91,'M底'),COLORGREEN;{MACD底背离}
A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));
B2:=REF(C,A2+1)>C AND REF("KDJ.K"(9,3,3),A2+1)<"KDJ.K"(9,3,3) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));
DRAWTEXT(FILTER(B2>0,3),L*0.93,'K底'),COLORYELLOW;{KDJ底背离}
A3:=BARSLAST(REF(CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));
B3:=REF(C,A3+1)>C AND REF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));
DRAWTEXT(FILTER(B3>0,5),L*0.95,'R底'),COLORFFFF00;{RSI底背离}
C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));
D1:=REF(C,C1+1)<C AND REF(DIFF,C1+1)>DIFF AND CROSS(DEA,DIFF);
DRAWTEXT(FILTER(D1>0,5),H*1.06,'M顶'),COLOR0066FF;{MACD顶背离}
C2:=BARSLAST(REF(CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3)),1));
D2:=REF(C,C2+1)<C AND REF("KDJ.K"(9,3,3),C2+1)>"KDJ.K"(9,3,3) AND CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3));