通达信公式源码概况:
指标类别:通达信公式
授权方式: 免费版
指标评级: ★★★★★
指标分类: 策略
画线方法: 副图
公式解读:
公式源码如下:
STICKLINE(CLOSE MA(CLOSE,N),O,C,2,0)COLORRED;
STICKLINE(CLOSE MA(CLOSE,N),O,C,2,0)COLORGREEN;
STICKLINE(CLOSE MA(CLOSE,M)ANDCLOSE MA(CLOSE,N),O,C,2,0)COLORYELLOW;
MA5:MA(C,5);
MA13:MA(C,13);
MA21:MA(C,21);
MA55:MA(C,55);
P能量5:LLV(C,5),COLORGRAY;
P能量10:LLV(C,10),COLORBLUE;
P能量20:LLV(C,20),COLORMAGENTA;
合力线:FORCAST(C,10),COLOR00FF00,LINETHICK2;
RSV:=(((CLOSE-LLV(LOW,33))/(HHV(HIGH,33)-LLV(LOW,33)))*12);
Y0:SMA(RSV,7,1),COLORRED;
Y1:SMA(SMA(RSV,7,1),3,1),COLORYELLOW;
Y2:(((CLOSE/COST(13)) =0.8)*10),COLORMAGENTA;
Y3:SMA(SMA(SMA(RSV,6,1),5,1),3,1),COLORGREEN;
DRAWICON(CROSS(18,Y0)ANDY1 21,10,1);
TYP:=(HIGH+LOW+CLOSE)/3;
CCI84:=(TYP-MA(TYP,84))/(0.015*AVEDEV(TYP,84)),COLORFF00FF;
DRAWBAND(CCI84,RGB(250,0,0),-100,RGB(0,0,250));
CCI14:=(TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14)),COLOR00FFFF,LINETHICK2;
DRAWBAND(CCI14,RGB(200,150,0),-100,RGB(0,150,0));
STICKLINE(1,100,100,5,0),COLOR00FFFF;
STICKLINE(1,-100,-100,5,0),COLOR00FF00;
STICKLINE(1,60,60,2,0),COLOR00FFFF;
STICKLINE(1,-40,-40,2,0),COLOR0000FF;
MA30:=MA(C,30);
MA72:=MA(C,72);
MA引力:=(MA30+MA72)/2,COLOR00FFFF,LINETHICK2;
BIASL:=(CLOSE-MA(CLOSE,MA引力))/MA(CLOSE,MA引力)*1000,COLORFF00FF,LINETHICK2;
DRAWBAND(BIASL,RGB(200,0,200),0,RGB(0,200,200));
0,COLOR0000FF,LINETHICK2;
CCI14A:CCI14,COLOR00FFFF,LINETHICK2;
CCI:CCI84,COLORFFFF00,LINETHICK2;
引力乖离:BIASL,COLORFFFFFF,LINETHICK2;
DRAWICON(CROSS(CCI14A,-100),-108,5);
DRAWICON(CROSS(CCI14,100),92,13);
DRAWICON(CROSS(CCI84,-100),-92,23);
DRAWICON(CROSS(CCI84,100),108,34);
DRAWICON(CROSS(BIASL,0),0,1);
DRAWICON(CROSS(100,CCI14A),108,14);
DRAWICON(CROSS(100,CCI84),92,35);
DRAWICON(CROSS(0,BIASL),0,2);
short:=9;
long:=18;
mid:=7;
持仓区:0,COLORYELLOW,LINETHICK0;
空仓区:0,COLORBLUE,LINETHICK0;
DIF:=EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:=EMA(DIF,MID);
MACD:2*(DIF-DEA),COLORSTICK;
STICKLINE(MACD =0,MACD,0,0,0),COLOR000FFF;
STICKLINE(MACD 0,MACD,0,0,0),COLORFF00FF;
STICKLINE(MACD REF(MACD,1)ANDMACD 0,0,MACD,0,0),COLORGREEN;
STICKLINE(MACD =REF(MACD,1)ANDMACD 0,0,MACD,0,0),COLORFFCC66;
趋势:IF(DIF DEA,DEA,DEA),COLORWHITE;
建仓:IF(DIF 0,DIF,0),COLOR0099FF;
加仓:IF(DIF 0,0,DIF),COLORRED;
清仓:IF(DIF DEA,DIF,DEA),COLORGREEN;
STICKLINE(DIF DEA,0.025,-0.025,10,1),COLORYELLOW;
STICKLINE(DIF DEA,0.025,-0.025,10,1),COLORBLUE;
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
B1:=REF(C,A1+1) CANDREF(DIF,A1+1) DIFANDCROSS(DIF,DEA);
A2:=BARSLAST(REF(CROSS( KDJ.K (9,3,3), KDJ.D (9,3,3)),1));
B2:=REF(C,A2+1) CANDREF( KDJ.K (9,3,3),A2+1) KDJ.K (9,3,3)ANDCROSS( KDJ.K (9,3,3), KDJ.D (9,3,3));
A3:=BARSLAST(REF(CROSS( RSI.RSI1 (6,12,24), RSI.RSI2 (6,12,24)),1));
B3:=REF(C,A3+1) CANDREF( RSI.RSI1 (6,12,24),A3+1) RSI.RSI1 (6,12,24)ANDCROSS( RSI.RSI1 (6,12,24), RSI.RSI2 (6,12,24));
C1:=BARSLAST(REF(CROSS(DEA,DIF),1));
D1:=REF(C,C1+1) CANDREF(DIF,C1+1) DIFANDCROSS(DEA,DIF);
C2:=BARSLAST(REF(CROSS( KDJ.D (9,3,3), KDJ.K (9,3,3)),1));
D2:=REF(C,C2+1) CANDREF( KDJ.K (9,3,3),C2+1) KDJ.K (9,3,3)ANDCROSS( KDJ.D (9,3,3), KDJ.K (9,3,3));
C3:=BARSLAST(REF(CROSS( RSI.RSI2 (6,12,24), RSI.RSI1 (6,12,24)),1));
D3:=REF(C,C3+1) CANDREF( RSI.RSI1 (6,12,24),C3+1) RSI.RSI1 (6,12,24)ANDCROSS( RSI.RSI2 (6,12,24), RSI.RSI1 (6,12,24));
MACD底背:IF(B1 0,-0.1,0),COLORRED,POINTDOT;
KDJ底背:IF(B2 0,-0.1,0),COLORFF00FF,POINTDOT;
RSI底背:IF(B3 0,-0.1,0),COLORYELLOW,POINTDOT;
MACD顶背:IF(D1 0,0.1,0),COLOR00FF00,POINTDOT;
KDJ顶背:IF(D2 0,0.1,0),COLORFFCC66,POINTDOT;
RSI顶背:IF(D3 0,0.1,0),COLORWHITE,POINTDOT;
RR8:=MA(CLOSE,27);
RR9:=(CLOSE-RR8)/RR8*100;
RRA:=MA(RR9,2);
RRB:=BARSLAST(CROSS(-10,RRA)=1);
RRD:=RRA -10ANDRRB
STICKLINE(IF(RRD,-120,0),-120,0,8,0),colorliblue;
:IF(RRD,-120,0),coloryellow,LINETHICK2;
TYP:=(HIGH+LOW+CLOSE)/3;
CCI14:(TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14)),colormagenta,LINETHICK2;
STICKLINE(B1 0,-0.1,0,2,0),COLORRED;
STICKLINE(B2 0,-0.15,-0.05,2,0),COLORFF00FF;
STICKLINE(B3 0,-0.2,-0.1,2,0),COLORYELLOW;
STICKLINE(D1 0,0.1,0,2,0),COLOR00FF00;
STICKLINE(D2 0,0.15,0.05,2,0),COLORFFCC66;
STICKLINE(D3 0,0.2,0.1,2,0),COLORWHITE;
DE:=CONST(LLV(L,90));
JI:=CONST(HHV(H,90))-DE;
DE_K:=DE+JI/3*2;
JI_K:=JI/2;
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
DE_A:=CONST(LLV(RSV,90));
DD_A:=CONST(HHV(RSV,90))-DE_A;
R:=(RSV-DE_A)/DD_A;
RSV1:=R*JI_K+DE_K;
K:SMA(RSV1,3,1);
D:SMA(K,3,1);
J:3*K-2*D;
DE_M:=DE+JI/3;
JI_M:=JI/2;
KDL:=CONST(LLV(EMA(C,26),90));
KDH:=CONST(HHV(EMA(C,26),90))-KDL;
R_K1:=(EMA(C,12)-KDL)/KDH;
R_K2:=(EMA(C,26)-KDL)/KDH;
DIF~:(R_K1-R_K2)*JI*1.5+DE_M;
DEA~:EMA(DIF~,9);
MACD~:=(DIF~-DEA~)*2+DE_M;
STICKLINE(MACD~ =DE_M,MACD~,DE_M,0,0),COLORLIBLUE;
D_1:=MACD~ HANDH =DE_MANDDE_M =L;
D_2:=MACD~ HANDH =LANDL DE_M;
D_3:=H MACD~ANDMACD~ =LANDL DE_M;
D_4:=H MACD~ANDMACD~ DE_MANDDE_M =L;
STICKLINE(D_1 0,H,DE_M,0,0),COLORYELLOW;
STICKLINE(D_2,H,L,0,0),COLORYELLOW;
STICKLINE(D_3,MACD~,L,0,0),COLORYELLOW;
STICKLINE(D_4,MACD~,DE_M,0,0),COLORYELLOW;
D_5:=MACD~ LANDL =DE_MANDDE_M =H;
D_6:=MACD~ LANDH DE_M;
D_7:=L MACD~ANDMACD~ =HANDH DE_M;
D_8:=L MACD~ANDMACD~ DE_MANDDE_M =H;
STICKLINE(MACD~ DE_M,DE_M,MACD~,0,0),COLORAA00AA;
STICKLINE(D_5,DE_M,L,0,0),COLORYELLOW;
STICKLINE(D_6,H,L,0,0),COLORYELLOW;
STICKLINE(D_7,H,MACD~,0,0),COLORYELLOW;
STICKLINE(D_8,DE_M,MACD~,0,0),COLORYELLOW;
L_00:DE_K;
L_20:JI_K/5+DE_K;
L_80:JI_K*4/5+DE_K;
L_100:JI_K+DE_K;
[源码注释]通达信公式动态公式解读
输出数: 880006$收盘价 ,画红色,NODRAW
输出跌停数: 880006$开盘价 ,画绿色,NODRAW