【通达信源码分享】精品指标公式-多空线主图源码

通达信免费指标 03-18 阅读:1077 评论:0

公式源码:


BB线:(MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4,LINETHICK0,DOTLINE;


IF(BB线>REF(BB线,1),BBI,DRAWNULL),COLORWHITE,LINETHICK2,DOTLINE;


IF(BB线<REF(BB线,1),BBI,DRAWNULL),COLORYELLOW,LINETHICK2,DOTLINE; 


 


MA120:MA(CLOSE,120)COLORYELLOW,DOTLINE;


MA250:MA(CLOSE,250)COLORMAGENTA,DOTLINE;


YT:=(H<REF(H,1)) OR (H>REF(H,1));


T0:=BARSLAST(YT);


本月低:LLV(L,T0+1),LINETHICK3,COLOR006600;


称帝:(COST(99)+COST(93)+COST(85))/3,COLORYELLOW,LINETHICK2;


IF(称帝>=REF(称帝,1),称帝,DRAWNULL),COLORYELLOW,LINETHICK2; 


IF(称帝< REF(称帝,1),称帝,DRAWNULL),COLORBLUE,LINETHICK2; 


DRAWTEXT_FIX(ISLASTBAR,0,0.02,0,STRCAT('地域:     ',DYBLOCK)),COLORYELLOW;


DRAWTEXT_FIX(ISLASTBAR,0.3,0.02,0,STRCAT('行    业:     ',HYBLOCK)),COLORYELLOW;


DRAWTEXT_FIX(ISLASTBAR,0,0.12,0,STRCAT('概    念:     ',GNBLOCK)),COLORRED; 


X:=(3*C+L+O+H)/6;


多空线:(20*X+19*REF(X,1)+18*REF(X,2)+17*REF(X,3)+16*REF(X,4)+15*REF(X,5)+14*REF(X,6)


+13*REF(X,7)+12*REF(X,8)+11*REF(X,9)+10*REF(X,10)+9*REF(X,11)+8*REF(X,12)


+7*REF(X,13)+6*REF(X,14)+5*REF(X,15)+4*REF(X,16)+3*REF(X,17)+2*REF(X,18)+


REF(X,20))/210,COLORGREEN,LINETHICK2;


IF(多空线>=REF(多空线,1),多空线,DRAWNULL),COLORRED,LINETHICK2; 


IF(多空线< REF(多空线,1),多空线,DRAWNULL),COLORGREEN,LINETHICK2; 


DRAWICON(CROSS( 本月低 ,多空线), 本月低 ,25),LINETHICK2;


DRAWTEXT(CROSS( 本月低 ,多空线),本月低-0.05,'获利买'),COLORGREEN;


DRAWICON(CROSS( C ,多空线), 多空线-0.05 ,25),LINETHICK2;


DRAWTEXT(CROSS( C ,多空线),本月低-0.05,'↖低吸'),COLORWHITE;


{跳空}


STICKLINE(REF(L,1)>H,H,REF(L,1),5,0),COLORGRAY;


STICKLINE(REF(H,1)<L,L,REF(H,1),5,0),COLORGRAY;


MA010:=MA(CLOSE,10),COLORYELLOW,LINETHICK0;


MA54:=MA(CLOSE,54),COLORFFCCCC,LINETHICK0;


PL1:=(((CLOSE - MA54) / MA54) < 0.1);


PL2:=(((CLOSE - MA010) / MA010) < 0.3);


偏离率:=(((PL1 = 1) AND (PL2 = 1)) * 0.2);


平台突破:=((((偏离率 = 0) AND (REF(偏离率,1) = 0.2)) AND (REF((COUNT((偏离率 = 0.2),10) = 10),1) = 1)) * 1);


DRAWTEXT(平台突破,L,'=================='),COLORWHITE;


 


MA05:=MA(C,5);


MA5角度: ATAN((MA05/REF(MA05,1)-1)*100)*180/3.1416,NODRAW;


T01:=CONST(LLVBARS(LOW,10));


T1HIGH:=CONST(REF(HIGH,T01));


下档线:=(((CLOSE - LLV(LOW,13)) / (HHV(HIGH,13) - LLV(LOW,13))) * 100);


VVAR1:=EMA(CLOSE,3)-EMA(CLOSE,6)-(EMA(CLOSE,6)-EMA(CLOSE,12))*(-100);


VVAR2:=EMA(VVAR1,3);


VVAR5:=CROSS(VVAR1,VVAR2);


VVAR6:=CROSS(VVAR2,VVAR1); 


AA:=IF(C>=REF(C,3),1,0);


BB:=IF(C>=REF(C,5),1,0);


CC:=IF(C>=REF(C,7),1,0);


DD:=IF(C>=REF(C,8),1,0);


EE:=IF(C>=REF(C,13),1,0);


FF:=IF(C>=REF(C,21),1,0);


GZ2:=AA+BB+CC+DD+EE+FF;


 


RRRSV:=SMA(下档线,3,1);


KKK:=SMA(RRRSV,3,1);


M5:= EMA(CLOSE,5);


M10:= EMA(CLOSE,10),LINETHICK0;


M30: MA(CLOSE,30),LINETHICK0;


M60: MA(CLOSE,60),LINETHICK0;


AA10:MA(CLOSE,8),COLOR00FF00,LINETHICK0;


AA12:MA(CLOSE,12),COLOR0000FF,LINETHICK0;


乖离5:=(C-M5)/M5*100;


斜率5:=ATAN((M5/REF(M5,1)-1)*100)*57.29583;


速度5:=SMA(EMA((M5-REF(M5,1))/REF(M5,1),3)*100,3,1);


加速度5:=EMA((速度5-REF(速度5,1)),3);


斜率10:=ATAN((M10/REF(M10,1)-1)*100)*57.29583;


乖离30:=(C-M30)/M30*100;


斜率30:=ATAN((M30/REF(M30,1)-1)*100)*57.29583;


强势狙击:=FILTER(斜率30>30 AND 斜率10>45 AND CROSS(斜率5,60),10);


加仓:=FILTER(COUNT(CROSS(斜率5,30),5)>=1 AND M5>REF(M5,1)  AND 乖离30>REF(乖离30,1) AND M10>REF(M10,1)


AND 加速度5>REF(加速度5,1) AND 速度5>REF(速度5,1)  ,10) ;


JC:=CROSS(0,乖离5) AND 乖离30<REF(乖离30,1) AND M10>REF(M10,1) ;


减仓:=FILTER(JC,10);


MR:=COUNT(CROSS(乖离5,0),3)>=1 AND 乖离30>REF(乖离30,1) AND M5>REF(M5,1) AND (C/REF(C,1)-1)*100>5 AND REF(C,1)<M30;


买入:=FILTER(MR,10) OR FILTER(KKK=0 AND GZ2>0 AND C>REF(C,1),10);


清仓:=FILTER(COUNT(CROSS(30,斜率5),5)>=1 AND (C>M30 OR O>M30) 


AND M5<REF(M5,1)  AND 乖离30<REF(乖离30,1) AND M10<REF(M10,1),10)


OR FILTER((KKK=6 AND GZ2<6),10);


DRAWICON(买入 OR 强势狙击 OR 加仓,LOW*0.995,1);


DRAWICON(减仓 OR 清仓,HIGH*1.005,2);


DRAWTEXT(减仓 OR 清仓,HIGH*1.005,'减仓'),COLORRED;


DRAWKLINE(H,O,L,C);


STICKLINE(VVAR6,OPEN,CLOSE,2.8,0),  COLORBLUE;


STICKLINE(VVAR5,OPEN,CLOSE,2.8,0),  COLORYELLOW;


STICKLINE(VVAR5,OPEN,CLOSE-(CLOSE-OPEN)*0.33,2.8,0), COLORAACCDD;


STICKLINE(VVAR5,OPEN,CLOSE-(CLOSE-OPEN)*0.66,2.8,0),  COLORRED;

30-1G0241I451.png

版权声明

本文版权归掌上指标所有。
未经许可,不得转载,转载请注明出处!

服务热线

18020657357

微信客服

微信客服