【通达信源码分享】简单实用的主图指标公式源码
2022-07-26未知 编 辑:掌上指标
A:=(3*C+L+O+H)/6;
X:=(20*A+19*REF(A,1)+18*REF(A,2)+17*REF(A,3)+16*REF(A,4)+15*REF(A,5)+
14*REF(A,6)+13*REF(A,7)+12*REF(A,8)+11*REF(A,9)+10*REF(A,10)+9*REF(A,11)+8*REF(A,12)
+7*REF(A,13)+6*REF(A,14)+5*REF(A,15)+4*REF(A,16)+3*REF(A,17)+2*REF(A,18)+
REF(A,20))/210;
回调认同:EMA(X,13),COLORGREEN;
周MACD:="MACD.MACD#WEEK"(12,26,9);
MACD:="MACD.MACD#DAY"(12,26,9);
斜率:=(EMA(回调认同,2)-REF(EMA(回调认同,2),2))/REF(EMA(回调认同,2),2)*100,NODRAW;
DRAWTEXT(CROSS(斜率,0),回调认同*0.97,'●')COLORRED;
DRAWTEXT(CROSS(0,MACD)AND CROSS(0,周MACD),回调认同*1.03,'●')COLORGREEN;
IF(斜率>=0,回调认同,DRAWNULL),COLORYELLOW,LINETHICK2;
IF(MACD>=0 AND 周MACD>=0,回调认同,DRAWNULL),COLORRED,LINETHICK3;
BIAS2:(C-MA(C,13))/MA(C,13)*100,NODRAW;
Q1:=CROSS(BIAS2,-30);
Q2:=CROSS(BIAS2,-25);
Q3:=CROSS(BIAS2,-20);
Q4:=CROSS(BIAS2,-15);
Q5:=CROSS(BIAS2,-10);
DRAWTEXT(Q2 AND EXIST(Q1,5),L*0.91,'J1');
DRAWTEXT(Q3 AND EXIST(Q2 OR Q1,5),L*0.92,'J2');
DRAWTEXT(Q4 AND EXIST(Q1 OR Q2 OR Q3,5),L*0.93,'J3');
DRAWTEXT(Q5 AND EXIST(Q1 OR Q2 OR Q3 OR Q4,5),L*0.95,'J4');
G1:=FILTER(CROSS(斜率,0),20);
G2:=BARSLAST(G1>0);
G3:=IFF(G2>0 AND G2<=20,1,0)=1 AND ((C-REF(C,G2))/REF(C,G2))*100>=10;
概1号:(SUM(FILTER(G3,20),0)/SUM(G1>0,0))*100,NODRAW;
STICKLINE(CLOSE> REF(CLOSE,1) ,HIGH,LOW,0,1 ),COLORRED;
STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,3,0 ),COLOR000055;
STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,2.7,0 ),COLOR000077;
STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,2.1,0 ),COLOR000099;
STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,1.5,0 ),COLOR0000BB;
STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,0.9,0 ),COLOR0000DD;
STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,0.3,0 ),COLOR0000FF;
STICKLINE(CLOSE= REF(CLOSE,1) ,HIGH,LOW,0,1 ),COLORWHITE;
STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,3,0 ),COLOR555555;
STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,2.7,0 ),COLOR777777;
STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,2.1,0 ),COLOR999999;
STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,1.5,0 ),COLORBBBBBB;
STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,0.9,0 ),COLORDDDDDD;
STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,0.3,0 ),COLORFFFFFF;
STICKLINE(CLOSE< REF(CLOSE,1) ,HIGH,LOW,0,1 ),COLORCYAN;
STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,3,0 ),COLOR990000;
STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,2.7,0 ),COLORCC0000;
STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,2.1,0 ),COLORFF4400;
STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,1.5,0 ),COLORFF8800;
STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,0.9,0 ),COLORFFCC00;
STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,0.3,0 ),COLORCYAN;