通达信指标公式源码概况:

指标类别: 通达信指标公式

授权方式: 免费版

指标评级: ★★★★★

指标分类: 策略

画线方法: 副图

一、庄家精准成本指标公式

  

DRAWGBK(O>C,RGB(160,32,240),RGB(56,94,15),0,'背景图',0);  

A01:=(WINNER((CLOSE*1))*100.000);  

A02:=(WINNER((CLOSE*1.1))*100.000);  

A03:=(WINNER((CLOSE*0.9))*100.000);  

A04:=MA(A03,5);  

A06:=(100-MA(A02,5));  

{STICKLINE(1,A06,MA(A02,5),2,1),COLORGREEN;}  

A08:=(MA(A02,5)-MA(A03,5));  

{STICKLINE(1,A04,MA(A02,5),2,1),COLORYELLOW;}  

A0A:=(((((HHV(A04,15)-A03)/A03)*100)>30)AND(HHV(A04,15)>50));  

STICKLINE(A0A,(0-2),2,2,1);  

STICKLINE(NOT(A0A),(0-2),2,2,1),COLORBLUE;  

STICKLINE(A03>REF(A03,1),0,A03,2,0),COLORRED;  

STICKLINE(A03<REF(A03,1),0,A03,2,1),COLORRED;  

获利:=MA(A03,1),COLORMAGENTA,DOTLINE;  

主力:MA(A03,10),COLORMAGENTA,LINETHICK2;  

套牢:=100-A02,COLORLIBLUE,DOTLINE;  

散户:(100.000-MA(A02,10)),COLORLIBLUE,LINETHICK2;  

浮动:=A02-A03,COLORLIRED,DOTLINE;  

游资:(MA(A02,10)-MA(A03,10)),COLORLIRED,LINETHICK2;  

STICKLINE(1,100,100,5,1),COLORGREEN;  

VAR1:=3;  

VAR2:=(3)*(SMA(((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27)))*(100),5,1))-(2)*(SMA(SMA(((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27)))*(100),5,1),3,1));  

股价启动在即:IF(CROSS(VAR2,VAR1),100,0),COLORYELLOW;  

秘密买点:IF((VAR2<=3),25,0),COLORFF00FF;  

机构建增补仓:IF((VAR2<5),45,0),COLOR00FF00;  

WIN10与WIN20金叉确定反弹信号(死叉应卖出),结合成交量,抓黑马无一漏网  

AA:=(C-COST(50))/COST(50)*100;{定义当前价与市场标准成本线差值}  

WIN:WINNER(CLOSE)*100;{定义获利盘超买超卖指标}  

WIN10:EMA(WIN,10);{定义短期获利盘指数平滑均线}  

WIN20:EMA(WIN,20);{定义长期获利盘指数平滑均线}  

CROSS(AA,30)ANDCROSS(WIN10,WIN20);{定义超跌反弹条件选股,可以将超跌的标准设定为30%,即凡是小于市场标准成本线30%的个股都视为超跌股.  

同时请记住:超跌并不意味着反弹!!!};  

80,POINTDOT;{获利盘>80超买.获利盘几乎为0超卖状态,空翻多};  

20,POINTDOT,colorwhite;  

100,COLORGREEN,LINETHICK2;  

上线1:=SMA(C,3,1);  

一号支撑线1:=SMA(C,8,1);  

A7:=(2*C+H+L)/4;  

操作:=MA(A7,5);  

全仓:if((CROSS(上线1,一号支撑线1)AND上线1>操作),20,0),Colorred;  

{VAR1:=1;  

VAR2:=1/WINNER(CLOSE);  

VAR3:=MA(CLOSE,13);  

VAR4:=100-ABS((CLOSE-VAR3)/VAR3*100);  

VAR5:=LLV(LOW,75);  

VAR6:=HHV(HIGH,75);  

VAR7:=(VAR6-VAR5)/100;  

VAR8:=SMA((CLOSE-VAR5)/VAR7,20,1);  

VAR9:=SMA((OPEN-VAR5)/VAR7,20,1);  

VARA:=3*VAR8-2*SMA(VAR8,15,1);  

VARB:=3*VAR9-2*SMA(VAR9,15,1);  

VARC:=30-VARB;  

主力:(100-VARA)*VAR1,COLOR0099FF;};  

{反转信号}  

N:=16;  

M1:=8;  

M2:=4;  

RSV:=(HHV(HIGH,N)-CLOSE)/(HHV(HIGH,N)-LLV(LOW,N))*100;  

LWR1:SMA(RSV,M1,1);  

LWR2:SMA(LWR1,M2,1);  

均5:=MA(CLOSE,4);  

X7:=EMA(EMA(EMA(HIGH,9),9),9);  

海底:=(X7*0.92);  

海底2:=(X7*0.933);  

中轨道:=MA(CLOSE,2);  

MA1:=MA(CLOSE,5);  

MA2:=MA(CLOSE,10);  

MA3:=MA(CLOSE,20);  

一穿三:=MA1>OANDMA2>OANDMA3>OANDMA1<CANDMA2<CANDMA3OPEN;  

DRAWTEXT(一穿三,LWR1,'←'),colorred;

image.png

二、显示庄家成本的指标公式

  

M1:=5;  

M2:=10;  

M3:=34;  

M4:=170;  

M5:=0;  

M6:=0;  

M7:=0;  

MA5:MA(CLOSE,M1);  

MA10:MA(CLOSE,M2);  

MA34:MA(CLOSE,M3);  

MA170:MA(CLOSE,M4);  

MA60:MA(CLOSE,M5);  

MA120:MA(CLOSE,M6);  

MA250:MA(CLOSE,M7);  

DRAWKLINE(H,O,L,C);  

DRAWTEXT_FIX(1,0.01,0,0,DYBLOCK),COLORYELLOW;  

DRAWTEXT_FIX(1,0.15,0,0,HYBLOCK),COLORYELLOW;  

DRAWTEXT_FIX(1,0.10,0.0,0,'概念:'),COLORYELLOW;  

DRAWTEXT_FIX(1,0.24,0,0,GNBLOCK),COLORYELLOW;  

DRAWTEXT_FIX(1,0.01,0.05,0,'风格:'),COLORGREEN;  

DRAWTEXT_FIX(1,0.08,0.05,0,FGBLOCK),COLORGREEN;  

{涨停统计}  

涨停:=CLOSE/REF(CLOSE,1)>=1.095;  

ZTCS:=COUNT(涨停,BARSSINCE(涨停)+1);  

DRAWNUMBER(涨停,HIGH*1.04,ZTCS),COLORYELLOW;  

GZT1:=STRCAT('共涨停:',CON2STR(ZTCS,0));  

GZT2:=STRCAT(GZT1,'次');  

SSTS1:=STRCAT('上市:',CON2STR(FINANCE(42),0));  

SSTS2:=STRCAT(SSTS1,'天');  

NTZZT1:=STRCAT('距今:',CON2STR(CONST(BARSLAST(涨停)),0));  

NTZZT2:=STRCAT(NTZZT1,'天有涨停');  

ZTTJ1:=STRCAT(SSTS2,GZT2);  

ZTTJ2:=STRCAT(ZTTJ1,NTZZT2);  

ZTTJ:=STRCAT('涨停统计:',ZTTJ2);  

DRAWTEXT_FIX(CURRBARSCOUNT=1,0,0.12,0,ZTTJ),COLORYELLOW;  

N:=80;  

M:=20;  

长振幅:=(HHV(H,N)-LLV(L,N))/LLV(L,N)*100;  

短振幅:=(HHV(H,M)-LLV(L,M))/LLV(L,M)*100;  

选庄:=长振幅<140and短振幅>20;  

长短结合:=FILTER((长振幅-短振幅)=HHV((长振幅-短振幅),15),10);  

过滤:=(C-LLV(L,3))/LLV(L,3)<0.25ANDC<MA(C,20);  

CCI参数:=CCI>-80ANDCCI<20;  

选庄AND长短结合ANDC>OAND过滤ANDCCI参数,COLORYELLOW;  

WIN10与WIN20金叉确定反弹信号(死叉应卖出),结合成交量,抓黑马无一漏网  

AA:=(C-COST(50))/COST(50)*100;{定义当前价与市场标准成本线差值}  

WIN:WINNER(CLOSE)*100;{定义获利盘超买超卖指标}  

WIN10:EMA(WIN,10);{定义短期获利盘指数平滑均线}  

WIN20:EMA(WIN,20);{定义长期获利盘指数平滑均线}  

CROSS(AA,30)ANDCROSS(WIN10,WIN20);{定义超跌反弹条件选股,可以将超跌的标准设定为30%,即凡是小于市场标准成本线30%的个股都视为超跌股.  

同时请记住:超跌并不意味着反弹!!!};  

80,POINTDOT;{获利盘>80超买.获利盘几乎为0超卖状态,空翻多};  

20,POINTDOT,colorwhite;  

100,COLORGREEN,LINETHICK2;  

上线1:=SMA(C,3,1);  

一号支撑线1:=SMA(C,8,1);  

A7:=(2*C+H+L)/4;  

操作:=MA(A7,5);  

全仓:if((CROSS(上线1,一号支撑线1)AND上线1>操作),20,0),Colorred;  

{VAR1:=1;  

VAR2:=1/WINNER(CLOSE);  

VAR3:=MA(CLOSE,13);  

VAR4:=100-ABS((CLOSE-VAR3)/VAR3*100);  

VAR5:=LLV(LOW,75);  

VAR6:=HHV(HIGH,75);  

VAR7:=(VAR6-VAR5)/100;  

VAR8:=SMA((CLOSE-VAR5)/VAR7,20,1);  

VAR9:=SMA((OPEN-VAR5)/VAR7,20,1);  

VARA:=3*VAR8-2*SMA(VAR8,15,1);  

VARB:=3*VAR9-2*SMA(VAR9,15,1);  

VARC:=30-VARB;  

主力:(100-VARA)*VAR1,COLOR0099FF;};  

{反转信号}  

N:=16;  

M1:=8;  

M2:=4;  

RSV:=(HHV(HIGH,N)-CLOSE)/(HHV(HIGH,N)-LLV(LOW,N))*100;  

LWR1:SMA(RSV,M1,1);  

LWR2:SMA(LWR1,M2,1);  

均5:=MA(CLOSE,4);  

X7:=EMA(EMA(EMA(HIGH,9),9),9);  

海底:=(X7*0.92);  

海底2:=(X7*0.933);  

中轨道:=MA(CLOSE,2);  

MA1:=MA(CLOSE,5);  

MA2:=MA(CLOSE,10);  

MA3:=MA(CLOSE,20);  

一穿三:=MA1>OANDMA2>OANDMA3>OANDMA1<CANDMA2<CANDMA3OPEN;  

DRAWTEXT(一穿三,LWR1,'←'),colorred;

image.png

[源码注释]通达信公式动态翻译结果

N赋值:80

M赋值:20

长振幅赋值:(N日内最高价的最高值-N日内最低价的最低值)/N日内最低价的最低值*100

短振幅赋值:(M日内最高价的最高值-M日内最低价的最低值)/M日内最低价的最低值*100

选庄赋值:长振幅<140 and="">20

长短结合赋值:(长振幅-短振幅)=15日内(长振幅-短振幅)的最高值的10日过滤

过滤赋值:(收盘价-3日内最低价的最低值)/3日内最低价的最低值<0.25 AND 收盘价<收盘价的20日简单移动平均

CCI参数赋值:CCI>-80 AND CCI<20

选庄 AND 长短结合 AND 收阳线AND 过滤 AND CCI参数 ,画黄色

推荐阅读:庄家建仓精准成本指标公式

  

五日:PPART(5);  

十日:PPART(10);  

二十:PPART(20);  

三十:PPART(30);  

六十:PPART(60);  

一百:PPART(100);  

三十获利盘:PWINNER(30,C);  

VAR1G:=(((CLOSE/MA(CLOSE,40))*100)<78);  

VAR2G:=(((CLOSE/MA(CLOSE,60))*100)<74);  

VAR3G:=(HIGH>(LOW*1.051));  

VAR4G:=(VAR3GAND(COUNT(VAR3G,5)>1));  

TFD:=IF((VAR4GAND(VAR1GORVAR2G)),2,0);  

TF:=C/REF(C,25)<=1.1;  

CC:=(SMA(MAX(C-REF(C,2),0),7,1)/SMA(ABS(C-REF(C,2)),7,1)*100)<15;  

V3:=(CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8))*100;  

线:=SMA(V3,2,1);  

V5:=SMA(线,2,1);  

BAO:=IF(线>REF(线,1)ANDREF(线,1)<REF(线,2)AND线<23,1.5,0);  

DUAN:TFANDTFDANDCCANDBAO,COLORRED;  

M:=55;  

N:=34;  

LC:=REF(CLOSE,1);  

RSI:=((SMA(MAX((CLOSE-LC),0),3,1)/SMA(ABS((CLOSE-LC)),3,1))*100);  

FF:=EMA(CLOSE,3);  

MA15:=EMA(CLOSE,21);  

DRAWTEXT(CROSS(85,RSI),75,'▼'),COLORGREEN;  

VAR1:=IF(YEAR>=2038ANDMONTH>=1,0,1);  

VAR2:=REF(LOW,1)*VAR1;  

VAR3:=SMA(ABS(LOW-VAR2),3,1)/SMA(MAX(LOW-VAR2,0),3,1)*100*VAR1;  

VAR4:=EMA(IF(CLOSE*1.3,VAR3*10,VAR3/10),3)*VAR1;  

VAR5:=LLV(LOW,30)*VAR1;  

VAR6:=HHV(VAR4,30)*VAR1;  

VAR7:=IF(MA(CLOSE,58),1,0)*VAR1;  

VAR8:=EMA(IF(LOW<=VAR5,(VAR4+VAR6*2)/2,0),3)/618*VAR7*VAR1;  

吸筹:IF(VAR8>100,100,VAR8)*VAR1,COLORRED;  

庄家吸筹:STICKLINE(吸筹>-150,0,吸筹,8,0),COLORRED;  

散户线:100*(HHV(HIGH,M)-CLOSE)/(HHV(HIGH,M)-LLV(LOW,M)),COLORFFFF00,LINETHICK2;  

RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;  

K:=SMA(RSV,3,1);  

D:=SMA(K,3,1);  

J:=3*K-2*D;  

庄家线:EMA(J,6),COLORFF00FF,LINETHICK2;  

VAR10:=100*(C-COST(20))/COST(20);  

VAR1:=(CLOSE-LLV(LOW,28))/(HHV(HIGH,28)-LLV(LOW,28))*100;  

VAR2:=SMA(VAR1,4,1);  

VAR3:=SMA(VAR2,2,1);  

VAR4:=VOL/CAPITAL*34;  

VAR5:=REF(VAR4,1);  

主力建仓提醒:IF(VAR3<8.5ANDVAR2<11,-10,0),COLORRED;  

空跌幅度:IF(VAR10<0,VAR10,0),COLORYELLOW,LINETHICK2;

image.png

每日公式解答:

公式编写要求:

“庄家存货”指标N:=3;VAR1:=1.13;VAR3:=LLV(HIGH,318);VAR4:=100*(CLOSE-VAR3)/VAR3*VAR1;VAR5:=REF(LLV(CLOSE,610),1)*VAR1;VAR6:=REF(HHV(CLOSE,610),1)*VAR1;VAR7:=100*(CLOSE-VAR5)/(VAR6-VAR5)*VAR1;VAR8:=(CLOSE-LLV(CLOSE,880))/(HHV(CLOSE,880)-LLV(CLOSE,880))*100*VAR1;VAR9:=(CLOSE-LLV(CLOSE,318))/(HHV(CLOSE,318)-LLV(CLOSE,318))*100*VAR1;VARA:=(CLOSE-LLV(LOW,880))/(HHV(HIGH,880)-LLV(LOW,880))*100*VAR1;VARB:=(CLOSE-LLV(LOW,318))/(HHV(HIGH,318)-LLV(LOW,318))*100*VAR1;VARC:=EMA(100*(CLOSE-LLV(LOW,144))/(HHV(HIGH,144)-LLV(LOW,144)),5)/4*VAR1;VARD:=IF(VARC>13.16,VARC,0)*VAR1;VARE:=VARC<1*VAR1;VARF:=VARD*VAR1;VAR10:=VAR4<0 AND VAR7<0;var11:=1;var12:=(high+low+close*2) var13:="EMA(VAR12,34);VAR14:=STD(VAR12,34);VAR15:=((VAR12-VAR13)/VAR14*100+200)/4*VAR11;VAR16:=(EMA(VAR15,89)-25)*1.56*VAR11;VAR17:=EMA(VAR16,5)*1.22*VAR11;VAR18:=EMA(VAR17,3)*VAR11;VAR19:=3*VAR17-2*VAR18*VAR11;VAR1A:=IF(CROSS(VAR19,VAR17)" and="" var1b:="IF(CROSS(VAR17,VAR19)" :="IF(FILTER(VAR8=100" vare="" var10="" varf="" var1c:="EMA(100*(CLOSE-LLV(LOW,100))/(HHV(HIGH,100)-LLV(LOW,100)),13)/4*VAR1;VAR1D:=EMA(CLOSE,2)-EMA(CLOSE,89)*VAR1;VAR1E:=EMA(VAR1D,21)*VAR1;VAR1F:=2*(VAR1D-VAR1E)*10*VAR1;VAR20:=POW(VAR1F,3)*0.1+POW(VAR1F,2)*VAR1;VAR21:=SQRT(SQRT(LOW*HIGH*OPEN*CLOSE));VAR22:=EMA(VAR21*0.97,3)*VAR1;VAR23:=(HIGH+LOW+CLOSE)/3*VAR1;VAR24:=(VAR23-MA(VAR23,14))/(0.015*AVEDEV(VAR23,14))*VAR1;VAR25:=IF(VAR1F">0.013,VAR20,0)/34*VAR1;拉升资金: VAR25*5,COLORRED,LINETHICK2;VAR26:=EMA(CLOSE,3)-EMA(CLOSE,144);VAR27:=EMA(VAR26,55);VAR28:=2*(VAR26-VAR27);VAR29:=POW(VAR28,3)*0.1+POW(VAR28,1);VAR2A:=SQRT(SQRT(LOW*HIGH*OPEN*CLOSE));VAR2B:=EMA(VAR2A*0.97,3);VAR2C:=(HIGH+LOW+CLOSE)/3;VAR2D:=(VAR2C-MA(VAR2C,14))/(0.015*AVEDEV(VAR2C,14));主力资金: IF(VAR28>0.01,VAR29*200,-100),LINETHICK2,COLORYELLOW;STICKLINE(VAR25>0,0,拉升资金,2,1),COLORRED; N1:=13;N2:=5;MTM:=C-REF(C,1);ZLGJ:=MA(100*EMA(EMA(MTM,N1),N1)/EMA(EMA(ABS(MTM),N1),N1),2),COLORWHITE;MAZL:=MA(MA(ZLGJ,N2),3),COLORYELLOW;DRAWICON(CROSS(ZLGJ,MAZL) AND MA(C,5)>=REF(MA(C,5),1) AND MA(C,2)>=REF(MA(C,2),1),MA(拉升资金,5),9);DRAWICON(CROSS(MAZL,ZLGJ) AND MA(C,5)=0,0,A1*50,1,1),COLORYELLOW;A1Q:=34;实体比例:=(CLOSE-OPEN)/REF(CLOSE,1);冲击系数:=MA(实体比例,A1Q),COLORRED;回头线:=MA(MA(冲击系数,2),2),COLORYELLOW;DRAWICON(CROSS(冲击系数,回头线) AND MA(C,5)>=REF(MA(C,5),1) ,MA(拉升资金,5),1);要求:对指标中的“主力资金”大于300并且在过去10天都小于300做个预警公式,先谢了

公式编写方法:

 VAR26:=EMA(CLOSE,3)-EMA(CLOSE,144);

VAR27:=EMA(VAR26,55);
VAR28:=2*(VAR26-VAR27);
VAR29:=POW(VAR28,3)*0.1+POW(VAR28,1);
主力资金:=IF(VAR28>0.01,VAR29*200,-100);
主力资金>300 AND REF(COUNT(主力资金<300,10)=10,1);

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。