有朋友经常询问这个公式那个公式的代码,实际复盘中用到的公式都在论坛中断断续续的分享过,现在为了方便大家的查找,做一个公式汇总。几点说明如下:
1、
正确对待公式,不要有极端看法。不要迷信公式,指标仅仅是辅助,真正做决策的是自己的大脑;不要排斥公式,如中正式步枪替代汉阳造,极大地提高了杀敌效率,是科技的进步。
2、
尝试自己编写或者修改公式。每个人的操作系统不一样,需要辅助的指标公式应该是有差异的,根据自己的操作习惯,适度调整公式,匹配自己的模式,会更高效。
3、
对于实在搞不定的朋友,索取外“包”服务,可以提供远程安装指导。但要记得加油或者捧场打点小费哦,通过发站内信求助。
指标公式汇总如下(通达信版本):
一、主图、副图指标公式:
1、主图:
EMA5:EMA(C,5),COLORWHITE;
EMA13:EMA(C,13),COLORYELLOW;
EMA34:EMA(C,34),COLORF00FF0;
EMA55:EMA(C,55),COLORGREEN;
AA05:=EMA5;
角度1:=ATAN((AA05/REF(AA05,1)-1)*100)*180/3.1416;
AA051:=EMA13;
角度2:=ATAN((AA051/REF(AA051,1)-1)*100)*180/3.1416;
AA052:=EMA34;
角度3:=ATAN((AA052/REF(AA052,1)-1)*100)*180/3.1416;
IF(角度1>60,EMA5,DRAWNULL),COLORRED,LINETHICK1;
IF(角度2>45,EMA13,DRAWNULL),COLORRED,LINETHICK1;
IF(角度3>30,EMA34,DRAWNULL),COLORRED,LINETHICK1;
涨停:=IF(REF(C,1)*1.1-C<0.01 ,1,0);
STICKLINE(涨停,OPEN,CLOSE,2.5,0),COLORYELLOW;
S1:="DMI.PDI";
S2:=S1>EMA(EMA(EMA(S1,2),2),2);
S3:= C/REF(C,1)>1.05;
DRAWTEXT(BETWEEN(DMI.PDI,37,45) AND S3 AND S2,L*0.98,‘↖亮剑‘),COLORYELLOW;
DRAWTEXT(BETWEEN(DMI.PDI,45,50)AND S3 AND S2,L*0.98,‘↖小牛‘),COLORYELLOW;
DRAWTEXT(BETWEEN(DMI.PDI,50,53)AND S3 AND S2,L*0.98,‘↖大牛‘),COLORYELLOW;
DRAWTEXT(DMI.PDI>53 AND S3 AND S2, L*0.98,‘↖疯牛‘),COLORYELLOW;
DRAWTEXT(REF(DMI.ADX,1)>50 AND CROSS(REF(DMI.ADX,1),DMI.ADX),H*1.01,‘↙变盘‘),COLORMAGENTA;
DRAWTEXT(REF(DMI.PDI,1)>53 AND CROSS(REF(DMI.PDI,1),DMI.PDI),H*0.98,‘←大顶‘),COLORGREEN;
DRAWTEXT(REF(DMI.PDI,1)<7 AND CROSS(DMI.PDI,REF(DMI.PDI,1)),L*1.02,‘←大底‘),COLORRED;
{通达信文字指标}
所属板块:=STRCAT(‘所属板块: ‘,STRCAT(STRCAT(STRCAT(‘[行业]-‘,HYBLOCK),STRCAT(‘ [地域]-‘,DYBLOCK)),STRCAT(‘ [概念]-‘,GNBLOCK)));
总股本:=STRCAT(STRCAT(‘总股本: ‘,CON2STR(TOTALCAPITAL/1000000,3)),‘亿股‘);
流通盘:=STRCAT(STRCAT(‘流通盘: ‘,CON2STR(CAPITAL/1000000,3)),‘亿股‘);
每股收益:=STRCAT(STRCAT(‘每股收益: ‘,CON2STR(FINANCE(29)/FINANCE(1),2)),‘元‘);
每股未分配:=STRCAT(STRCAT(‘每股未分配: ‘,CON2STR(FINANCE(32),2)),‘元‘);
每股公积金:=STRCAT(STRCAT(‘每股公积金: ‘,CON2STR(FINANCE(18),2)),‘元‘);
每股净资产:=STRCAT(STRCAT(‘每股净资产: ‘,CON2STR(FINANCE(34),2)),‘元‘);
总市值:=STRCAT(STRCAT(‘总市值: ‘,CON2STR(FINANCE(1)*C/100000000,3)),‘亿元‘);
市值:=STRCAT(STRCAT(‘流通值: ‘,CON2STR((CAPITAL/1000000)*C,3)),‘亿元‘);
SHI:INT
PA RT(DATE+19000000),NODRAW;
上市日期:=STRCAT(‘ 上市日:‘,CON2STR(SHI,0));
收入同比增长:=STRCAT(STRCAT(‘收入同比增长: ‘,CON2STR(FINANCE(44),2)),‘%‘);
市盈率:=STRCAT(‘市盈率: ‘,CON2STR(DYNAINFO(39),2));
主营毛利润率:=STRCAT(STRCAT(‘主营毛利润率: ‘,CON2STR((FINANCE(20)-FINANCE(21))/FINANCE(20)*100,2)),‘%‘);
主营净利润率:=STRCAT(STRCAT(‘主营净利润率: ‘,CON2STR(FINANCE(30)/FINANCE(20)*100,2)),‘%‘);
主营利润率:=STRCAT(‘ 主营利润率 ‘,CON2STR(FINANCE(23)/FINANCE(20)*100,2));
净利同比增长:=STRCAT(STRCAT(‘净利同比增长: ‘,CON2STR(FINANCE(43),2)),‘%‘);
DRAWTEXT_FIX(ISLASTBAR,0.002,0,0,‘上市日期:‘),COLORMAGENTA;
DRAWNUMBER_FIX(ISLASTBAR,0.037,0,0,SHI),COLORMAGENTA;
DRAWTEXT_FIX(ISLASTBAR,0.002,0.05,0,所属板块),COLORMAGENTA;
DRAWTEXT_FIX(ISLASTBAR,0.002,0.10,0,总股本),COLORCYAN;
DRAWTEXT_FIX(ISLASTBAR,0.127,0.10,0,收入同比增长),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,0.257,0.10,0,每股收益),COLORCYAN;
DRAWTEXT_FIX(ISLASTBAR,0.002,0.15,0,流通盘),COLORCYAN;
DRAWTEXT_FIX(ISLASTBAR,0.127,0.15,0,主营毛利润率),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,0.257,0.15,0,每股净资产),COLORCYAN;
DRAWTEXT_FIX(ISLASTBAR,0.002,0.20,0,总市值),COLORCYAN;
DRAWTEXT_FIX(ISLASTBAR,0.127,0.20,0,主营净利润率),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,0.257,0.20,0,每股未分配),COLORCYAN;
DRAWTEXT_FIX(ISLASTBAR,0.002,0.25,0,市值),COLORCYAN;
DRAWTEXT_FIX(ISLASTBAR,0.127,0.25,0,净利同比增长),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,0.257,0.25,0,每股公积金),COLORCYAN;
DRAWTEXT_FIX(ISLASTBAR,0.002,0.25,0,市盈率),COLORCYAN;
HSL:=100*VOL/(FINANCE(7)/100);
换手:=STRCAT(STRCAT(‘换手: ‘,CON2STR(HSL,2)),‘%‘);
DRAWTEXT_FIX(ISLASTBAR,0.85,0.95,0,换手),COLORMAGENTA;
CJ:=DYNAINFO(10)/100000000;
成交:=STRCAT(STRCAT(‘成交: ‘,CON2STR(CJ,2)),‘亿‘);
DRAWTEXT_FIX(ISLASTBAR,0.85,1,0,成交),COLORMAGENTA;
2、副图:
TOTAL:=IF(PERIOD=1,5,IF(PERIOD=2,15,IF(PERIOD=3,30,IF(PERIOD=4,60,IF(PERIOD=5,TOTALFZNUM,1)))));
MTIME:=MOD(FROMOPEN,TOTAL);
CTIME:=IF(MTIME<0.5,TOTAL,MTIME);
VVOL:IF((CURRBARSCOUNT=1 AND DYNAINFO(8)>1),VOL*TOTAL/CTIME,DRAWNULL),NODRAW;
STICKLINE((CURRBARSCOUNT=1 AND DYNAINFO(8)>1),VVOL,0,-1,-1),COLOR00C0C0;
VOLUME:VOL,VOLSTICK;
日收盘:=C#DAY;日最高:=H#DAY;日最低:=L#DAY;
涨停:=IF(REF(日收盘,1)*1.095-日收盘<0.01 ,1,0) AND 日收盘=日最高 ;
CE3:=REF(日收盘,1);
跌停:=IF((CE3-日收盘)*100/CE3>=(10-0.01*100/CE3),1,0) AND 日收盘=日最低;
STICKLINE(涨停,0,V,2.5,0),COLORYELLOW;{如果太大或太小,调整3的数值大小就可以};
AA:=VOL>REF(V,1)*2.0;
STICKLINE(AA,0,V,1.25,0),COLORMAGENTA;
二、盘中常用预警公式:
每一小段是一个公式,上面是程式,下面是公式名称。
C>=REF(C,1)*1.05;
↑涨5点
C<=REF(C,1)*0.96;
↓跌4点
C>REF(HHV(H,0),1);
↑历史新高
C>=HHV(H,20);
↑20日新高
TY:=C;
A1:=REF(TY,10)=HHV(TY,2*10+1); B1:=FILTER(A1,10); C1:=BACKSET(B1,10+1); HD:=FILTER(C1,10);
A2:=REF(TY,10)=LLV(TY,2*10+1); B2:=FILTER(A2,10); C2:=BACKSET(B2,10+1); LD:=FILTER(C2,10);
前期高位:=REF(C,BARSLAST(HD));
CROSS(C,前期高位);
↑前期新高
C>=REF(C,1)*1.1;
↑↑涨停
C<=REF(C,1)*0.90;
↓↓跌停
AA:=IF(PERIOD=0,C*V,AMOUNT/100);
TT:=BARSCOUNT(C);
CROSS(C,SUM(AA,TT)/SUM(V,TT)) ;
↗上穿
S1:="DMI.PDI";
S2:=S1>EMA(EMA(EMA(S1,2),2),2);
S3:=DYNAINFO(4)>0;
BETWEEN(DMI.PDI,37,45) AND S2 AND S3;
↗亮剑
S1:="DMI.PDI";
S2:=S1>EMA(EMA(EMA(S1,2),2),2);
BETWEEN(DMI.PDI,45,50) AND S2;
↗小牛
S1:="DMI.PDI";
S2:=S1>EMA(EMA(EMA(S1,2),2),2);
BETWEEN(DMI.PDI,50,53) AND S2;
↗大牛
S1:="DMI.PDI";
S2:=S1>EMA(EMA(EMA(S1,2),2),2);
DMI.PDI>=53 AND S2;
↗疯牛
C>=REF(C,1)*1.08;
↑准备打板
REF(L,1)<=REF(O,1)*0.95 AND REF(C,1)>=REF(L,1)*1.05 AND C>=REF(H,1);
$$大长腿
C>=REF(C,2)*1.185;
¥打2板
C>=REF(C,3)*1.30;
¥打3板
三、复盘常用公式
与上面的预警公式是通用的,仅仅是侧重点不同,有重复的,但还是集中贴一下。
S1:=NOT(C>=REF(C,1)*1.095 AND C=O AND H=L);
S2:=DYNAINFO(4)>0;
S3:=IF(NAMELIKE(‘ST‘) OR NAMELIKE(‘*ST‘),0,1);
S4:=FINANCE(42)>1;
H=HHV(H,0) AND S1 AND S2 AND S3 AND S4;
//历史新高
S1:=NOT(C>=REF(C,1)*1.0994 AND C=O AND H=L);
A:=C/REF(C,1)>1.0994 AND S1;
COUNT(A,2)=2;
++2连板(换)
S2:=DYNAINFO(4)>0;{剔除停牌股}
S4:=FINANCE(42)>1;{剔除首日上市新股}
L=LLV(L,180) AND S2 AND S4;
!新低
S1:=NOT(C>=REF(C,1)*1.095 AND C=O AND H=L);{剔除一字板}
S2:=DYNAINFO(4)>0;{剔除停牌股}
ZT:=(CLOSE/REF(CLOSE,1)-1)*100; A1:=ZT>9.93 AND CLOSE=HIGH;
XG:REF(A1,1) AND S1 AND S2; **昨日涨停 ZTJ:=ZTPRICE(REF(CLOSE,1),0.1);
CB:H=ZTJ AND C<H ; //冲板未封 S1:=NOT(C>=REF(C,1)*1.094 AND C=O AND H=L);{剔除一字板}
S2:=DYNAINFO(4)>0;{剔除停牌股}
S4:=FINANCE(42)>1;{剔除首日上市新股}
XG:L>REF(H,1) AND C/REF(C,1)>1.03 AND C/REF(C,1)<1.0994 AND S1 AND S2 AND S4 ; 跳空缺口 (REF(H,1)-MAX(REF(C,1),REF(O,1)))/(REF(H,1)-REF(L,1))>0.7 AND (MIN(O,C)-L)/(H-L)>0.7; //揉搓线 (H-MAX(C,O))/(H-L)>0.5 AND C/REF(C,1)>1.02 AND V/REF(V,1)>1.5 AND (H-L)/REF(C,1)*100>5; //长上引 (MIN(O,C)-L)/(H-L)>0.7 AND (H-L)/REF(C,1)*100>5 ; //长下引