特 别 提 醒
公式信号处理上不存在未来函数!该公式原理属动量型,与均线公式相异,参考值准确即时。该公式与所有公式一样存在类似缺陷,收盘与盘中可能存在的买卖差距或出现跳空缺口,近似不可操作情况。但不管如何,买卖总需要一个科学性的参考,而不是随意的,在类似参考上修正总结提高,才能如火纯青修成正果。
建立公式及说明:
1、公式针对通达信软件(Ⅴ7.17)编制,其它软件版本已丢失,需要自行改编!
2、该公式考虑到初学者使用,在公式系统中只需新建公式,写入
必胜剑法名称,无需参数设置,直接复制粘贴后设为主图既可。
3、为简单化,公式放弃图标图片和公式的引用一惯方式,进行了合并改写。由于很久
未编写公式了,难免有错或效果差异。
4、本人很少在网上,有关问题不能一一即时答复,请鉴谅!
5、图示及使用说明:图左下角有统计数据。可选择成功率或收益相对高的个股,短线可选信号频率高的即每百日K线数字大的,表示活跃程度。
买入以红箭头表示,卖出信号分三类图标,钱袋---赚,s---微利,绿箭头---亏损 卖出。
M0为五日均线强弱参考。
祝朋友们在股市驰逞好运!
A:=5; EC:=INBLOCK('沪深A股'),NODRAW;
FB:=IF(EC=1,IF(CAPITAL>=200000000,A-2,IF(CAPITAL<200000000 AND CAPITAL>20000000,A-1,A)),A-2);
FS:=IF(EC=1,IF(CAPITAL>=200000000,A-1,IF(CAPITAL<200000000 AND CAPITAL>20000000,A,A+1)),A-1);
LMK:=(LLV(L,REF(HHVBARS(H,14),1)+1))*(1+FB/100);
BJJ:=IF(CROSS(C,LMK),LMK,0);
YBN:=BARSLAST(BJJ>0 OR BARSCOUNT(C)=1);
HMK:=HHV(H,YBN+1)*(1-FS/100);
SJJ:=IF(CROSS(HMK,C),HMK,IF(REF(YBN,1)=0 AND REF(HMK,1)>C,O,0));
YSN:=BARSLAST(SJJ>0 OR BARSCOUNT(C)=1);
EX11:=HHV(BJJ>0,YSN+1);
REE:=IF(BARSCOUNT(C)=1,0,REF(EX11,1));
YBJ:=IF(EX11>REE,BJJ,0),LINETHICK1,COLOR0088FF;
YSJ:=IF(EX11<REE,SJJ,0),LINETHICK1,COLOR00FF00;
PE:=IF(EX11=0,LMK,-HMK),NODRAW;
NBJ:=YBJ; NSJ:=YSJ;
BAR:=HHV(NBJ>0,0); X0:=SUM(BAR,0);
BN:=BARSLAST(NBJ>0);
SN:=BARSLAST(NSJ>0);
EX10:=HHV(NBJ,SN+1);
RE:=IF(BARSCOUNT(C)=1,0,REF(EX10,1));
BBJ:=IF(EX10>RE,NBJ,0); SSJ:=IF(EX10<RE,NSJ,0);
RBJ:=REF(BBJ,BN);
BSYL:=100*(IF(SSJ=0,C,SSJ)*0.997/RBJ/1.003-1);{佣金费率}
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
M0:MA(L,5),COLOR00FFFF;
预警:IF(BBJ>0,BBJ,IF(SSJ>0,SSJ,ABS(PE))),NODRAW;
多头盈利:BSYL,NODRAW;
BJ:=IF(BBJ>0,BBJ,DRAWNULL),NODRAW;
SJ:=IF(SSJ>0,SSJ,DRAWNULL),NODRAW;
DRAWICON(BJ>0,LLV(L,5),23);
DRAWICON(SJ>0 AND BSYL<0,H,2),DRAWABOVE;
DRAWICON(SJ>0 AND BSYL>0 AND BSYL<5,H,8),DRAWABOVE;
DRAWICON(SJ>0 AND BSYL>5,H,9),DRAWABOVE;
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
QQ:=1000000;
信号K%:=(X0>100)*100*SUM(SSJ>0,0)/X0,NODRAW;
卖次:SUM(SSJ>0,0),NODRAW;
成功率:=(卖次>10)*100*SUM(BSYL*(SSJ>0)>0,0)/卖次,NODRAW;
股数:=100*INTPART(QQ/RBJ/1.003/100),NODRAW;
差额:=(SSJ>0)*(SSJ*0.997-RBJ*1.003)*股数,NODRAW;
总盈利率:=100*SUM(差额,0)/QQ;
DA0:=HHV(IF(BARSCOUNT(C)=1,DATE,0),0);
年:=(DATETODAY(DATE)-DATETODAY(DA0))/365,NODRAW;
年收益:(年>=1)*总盈利率/年,NODRAW;
KKT:=STRCAT('计算',CON2STR(TOTALBARSCOUNT,0));
YE:=STRCAT('K线=',CON2STR(年,2));
SY:=STRCAT('年 收益 ',CON2STR(总盈利率,1));
SY2:=STRCAT('%(+',STRCAT(CON2STR((PE<0)*BSYL,1),')'));
百K:=STRCAT('% 信号 ', CON2STR(信号K%,1));
CG:=STRCAT('%K 成功率 ',CON2STR(成功率,1));
TX:=STRCAT(KKT,STRCAT(YE,STRCAT(SY,STRCAT(SY2,STRCAT(百K,CG)))));
DRAWTEXT_FIX(ISLASTBAR,0.0,1,0,TX),COLOR00FFFF;
DRAWTEXT_FIX(ISLASTBAR,0.02,0,0,STRCAT(HYBLOCK,'板块')),COLOR0000FF;
{PDA:=1; NBJ:=IF(JK<=1,YA王.BJ,JKGS.BJ)*PDA;
BAR:=HHV(NBJ>0,0); X0:=SUM(BAR,0);
NSJ:=IF(JK<=1,YA王.SJ,JKGS.SJ)*BAR;
BJ2:=IF(JK<=1,YA王.BJ2,0)*BAR;
SN:=BARSLAST(NSJ>0 OR BARSCOUNT(C)=1);
EX10:=HHV(NBJ,SN+1);
RE:=IF(BARSCOUNT(C)=1,0,REF(EX10,1));
BBJ:=IF(EX10>RE,NBJ,0); SSJ:=IF(EX10<RE,NSJ,0);
PE:=IF(JK<=1,YA王.PE,GSJK.PE)*BAR;
TB:=CALCSTOCKINDEX('999999SH','YA王',1);
PJ2:=IF(BJ2>0 AND JK=1,BJ2,BJ);
STICKLINE(BJ>0 OR BJ2>0,PJ2,PJ2,9,0),COLORFF00FF;
STICKLINE(SJ>0,SJ ,SJ,9,0),COLOR00FF00;
P预:=IF(ISLASTBAR=0,DRAWNULL,预警);
STICKLINE(ISLASTBAR,P预,P预,9,0),COLOR00FFFF;
预:=STRCAT(IF(BBJ>0,' 预警买点',IF(SSJ>0,' 预警卖点',IF(PE>0 AND BBJ=0 AND SSJ=0,
' 预警买点',' 预警卖点 '))),CON2STR(预警,2));
DRAWTEXT_FIX(ISLASTBAR,0.8,1,0,预),COLOR0088FF;
DRAWTEXT(BJ2>0 AND BBJ=0 AND JK=1,L,'短'),COLOR0088FF;};