以下是通达信密码主图指标公式源码和使用说明
通达信牛股密码主图指标公式源码:
M1:=12;
M2:=50;
M3:=60;
EXP1:expma(CLOSE,M1);
EXP2:EXPma(CLOSE,M2);
EXP3:EXPMA(CLOSE,M3);
AB:=EMA(((2*C+H+L)/4-LLV(LOW,30))/(HHV(HIGH,30)-LLV(LOW,30))*100,8);
BA:=EMA(AB,5);
A1{高}:=REFDATE(REF(HHV(H,96),5),DATE);
B1{低}:=REFDATE(REF(LLV(L,96),5),DATE);
DY{中}:=((A1)+(B1))/2;
箱顶:IF(AB 0ANDAB-BA =0,A1,A1),LINETHICK3,COLOR00FF00;
箱腰:IF(AB 0ANDAB-BA =0,DY,DY),LINETHICK3,COLOR00FF00;
箱低:IF(AB 0ANDAB-BA =0,B1,B1),LINETHICK3,COLOR00FF00;
高1:IF(AB 0ANDAB-BA 0,A1,DRAWNULL),LINETHICK3,COLORRED;
中1:IF(AB 0ANDAB-BA 0,DY,DRAWNULL),LINETHICK3,COLORRED;
低1:IF(AB 0ANDAB-BA 0,B1,DRAWNULL),LINETHICK3,COLORRED;
顶周期:=topRANGE(H);底周期:=LOwrANGE(L);
上内:=LLVBARS(H,顶周期);上外:=LLVBARS(L,顶周期);
下内:=HHVBARS(L,底周期);下外:=HHVBARS(H,底周期);
上力度:=HHV(L,上内+1) LLV(H,上内+1);
下力度:=HHV(L,下内+1) LLV(H,下内+1);
上包含:=COUNT(L =REF(L,1),上外) 2ANDCOUNT(H =REF(H,1),上内)
下包含:=COUNT(H =REF(H,1),下外) 2ANDCOUNT(L =REF(L,1),下内)
顶0:=顶周期AND上力度AND上包含AND上外
底0:=底周期AND下力度AND下包含AND下外
顶分天数:=BArslAst(顶0);
底分天数:=BARSLAST(底0);
含中间:=IF(顶分天数=0,底分天数,顶分天数)
顶:=顶0AND含中间K线ANDH=HHV(H,BARSLAST(底0));
底:=底0AND含中间K线ANDL=LLV(L,BARSLAST(顶0));
NOTEXT上笔划线:DRAWLINE(底,L,顶,H,0),COLORLIRED,LINETHICK3;
NOTEXT下笔划线:DRAWLINE(顶,H,底,L,0),COLORLIGREEN,LINETHICK3;
分界点:=NOTEXT上笔划线ANDNOTEXT下笔划线;
位置调整:=
IF(PERIOD=11,0.02,{年}
IF(PERIOD=10,0.02,{季}
IF(PERIOD=9,0.02,{多日}
IF(PERIOD=8,0.001,{多分钟}
IF(PERIOD=7,0.02,{月}
IF(PERIOD=6,0.01,{周}
IF(PERIOD=5,0.005,{日}
IF(PERIOD=4,0.002,{60F}
IF(PERIOD=3,0.001,{30F}
IF(PERIOD=2,0.001,{15F}
IF(PERIOD=1,0.0003,{5F}
IF(PERIOD=0,0.0002,{1F}0))))))))))));
DRAWNUMBER(分界点AND顶,H+H*位置调整,H),COLORLIGREEN;
DRAWNUMBER(分界点AND底,L,L),COLORLIMAGENTA;
JJX:=Abs(OPEN+HIGH+LOW+CLOSE)/4;
生命:MA(JJX,5),COLORYELLOW;
VL:=REF(LOW,1);VH:=REF(H,1);
VAR1:=SMA(ABS(H-VH),13,1)/SMA(MAX(H-VH,0),13,1)*100;
VAR2:=SMA(ABS(L-VL),13,1)/SMA(MAX(L-VL,0),13,1)*100;
VAR3:=MA(VAR1,13);
VAR4:=MA(VAR2,13);
VAR5:=LLV(L,34);
VAR6:=HHV(H,34);
VAR7:=EMA(IF(H =VAR6,VAR3,0),3);
VAR8:=EMA(IF(L =VAR5,VAR4,0),3);
VAR9:=(SMA(SMA((((CLOSE-LLV(LOW,54))/(HHV(HIGH,54)-LLV(LOW,54)))*100),7,1),5,1));
VAR10:=((SMA(((CLOSE-LLV(LOW,54))/(HHV(HIGH,54)-LLV(LOW,54))*100),7,1))*16.18)-(VAR9*10.9);
VAR11:=FILTER(IF(VAR10 =VAR9ANDVAR8 REF(VAR8,1),VAR8*8,0),55);
VAR21:=LLV(LOW,60);
VAR31:=HHV(HIGH,60);
VAR41:=EMA((CLOSE-VAR21)/(VAR31-VAR21)*100,13);
VAR51:=EMA(0.667*REF(VAR41,1)+0.333*VAR41,21);
VARL2:=FILTER(crOSS(VAR51,VAR41)ANDVAR41 84,13);
{k线}
STICKLINE(CLOSE OPENORCLOSE=OPENANDCLOSE REF(CLOSE,1),LOW,HIGH,0.1,0),COLORRED;
STICKLINE(CLOSE OPENORCLOSE=OPENANDCLOSE REF(CLOSE,1),OPEN,CLOSE,4,0),COLORRED;
STICKLINE(CLOSE OPENORCLOSE=OPENANDCLOSE =REF(CLOSE,1),LOW,HIGH,0.1,0),COLOR00FF00;
STICKLINE(CLOSE OPENORCLOSE=OPENANDCLOSE =REF(CLOSE,1),OPEN,CLOSE,4,0),COLOR00FF00;
STICKLINE(OPEN =CLOSE,CLOSE,OPEN,0,0),COLOR00FF00;
STICKLINE(OPEN =CLOSE,CLOSE,OPEN,4,0),COLOR008800;
STICKLINE(OPEN =CLOSE,CLOSE,OPEN,3.5,0),COLOR009900;
STICKLINE(OPEN =CLOSE,CLOSE,OPEN,3,0),COLOR00AA00;
STICKLINE(OPEN =CLOSE,CLOSE,OPEN,2.5,0),COLOR00BB00;
STICKLINE(OPEN =CLOSE,CLOSE,OPEN,2,0),COLOR00CC00;
STICKLINE(OPEN =CLOSE,CLOSE,OPEN,1.5,0),COLOR00DD00;
STICKLINE(OPEN =CLOSE,CLOSE,OPEN,1,0),COLOR00EE00;
STICKLINE(OPEN =CLOSE,CLOSE,OPEN,0.5,0),COLOR00FF00;
STICKLINE(CLOSE OPEN,CLOSE,OPEN,0,0),COLORFFBBFF;
STICKLINE(CLOSE OPEN,CLOSE,OPEN,4,0),COLORFF00FF;
STICKLINE(CLOSE OPEN,CLOSE,OPEN,3.5,0),COLORFF22FF;
STICKLINE(CLOSE OPEN,CLOSE,OPEN,3,0),COLORFF44FF;
STICKLINE(CLOSE OPEN,CLOSE,OPEN,2.5,0),COLORFF66FF;
STICKLINE(CLOSE OPEN,CLOSE,OPEN,2,0),COLORFF88FF;
STICKLINE(CLOSE OPEN,CLOSE,OPEN,1.5,0),COLORFF99FF;
STICKLINE(CLOSE OPEN,CLOSE,OPEN,1,0),COLORFFAAFF;
STICKLINE(CLOSE OPEN,CLOSE,OPEN,0.5,0),COLORFFBBFF;
持股线:MA(C,26),LINETHICK2,COLOR6600FF;
DRAWTEXT(VAR11,L*0.98,'锁定'),COLORFFFF00;
STICKLINE(VAR11,H,L,1,1),COLORRED;
STICKLINE(VAR11,OPEN,CLOSE,4.5,0),COLOR000099;
STICKLINE(VAR11,OPEN,CLOSE,3,0),COLOR0000BB;
STICKLINE(VAR11,OPEN,CLOSE,2,0),COLOR0000FF;
DRAWTEXT(VARL2,H*1.04,'快逃跑'),COLORYELLOW;
STICKLINE(VARL2,H,L,1,1),COLORYELLOW;
STICKLINE(VARL2,OPEN,CLOSE,4.5,0),COLOR00CCCC;
STICKLINE(VARL2,OPEN,CLOSE,3,0),COLOR33FFCC;
STICKLINE(VARL2,OPEN,CLOSE,2,0),COLOR00FFFF;
M1:=13;M2:=63;M3:=133;M4:=256;
A:=EMA((EMA(CLOSE,29)+EMA(CLOSE,31)+EMA(CLOSE,33))/3,3),COLORYELLOW;
B:=REF(A,1);
STICKLINE(A B,A,B,3,0),COLORFF00FF;
STICKLINE(A =B,A,B,3,1),COLORFF0000;
MA1:EMA(CLOSE,M1);
MA2:EMA(CLOSE,M2);
MA3:EMA(CLOSE,M3);
MA4:EMA(CLOSE,M4);
通达信牛股密码主图指标公式截图