以下是通达信霸王剑指标公式源码和使用说明
通达信霸王剑指标公式源码:
N:=16;
A1:=ATAN((C/REF(C,N)-1)*57.05);
A2:SUM(A1,0);
A4:EMA(A2,60);
A3:EMA(A2,10);
DRAWBAND(A2,120,A3,RGB(35,135,35));
DRAWTEXT(CROSS(A2,A3),A3,'启动'),COLORYELLOW;
DRAWTEXT(CROSS(A2,A4),A3,'加速'),COLORMAGENTA;
百胜买点:MA(CLOSE,30)/REF(MA(CLOSE,30),8) 1.04AND
COUNT(CLOSE MA(CLOSE,30),8)=8AND
HHV(HIGH,8)/MA(CLOSE,30) 1.1AND
MA(CLOSE,5) MA(CLOSE,10)ANDMA(CLOSE,10) MA(CLOSE,30)AND
COUNT(crOSS(MA(CLOSE,10),MA(CLOSE,30)),3)=1AND
CLOSE OPENANDCLOSE/REF(CLOSE,1) 0.96,STICK,LINETHICK3,COLORYELLOW;
A1AA:=OPEN REF(CLOSE,1);
A2AA:=BETWEEN((CLOSE/REF(CLOSE,1)),1,1.03);
A3AA:=MA(CLOSE,30)/REF(MA(CLOSE,30),1) 1.005;
A4AA:=BETWEEN((CLOSE/MA(CLOSE,30)),1,1.05);
A5AA:=/REF(VOL,1)
A6AA:=MA(CLOSE,10)/REF(MA(CLOSE,10),1) 1.005;
追涨屠牛:=A1AAANDA2AAANDA3AAANDA4AAANDA5AAANDA6AA,LINETHICK1,COLORLIBLUE;
JJD:=(H+L+C)/3;
强势线1:=HHV(MA((((LOW+HIGH)+CLOSE)/3),8),60),COLORRED,LINETHICK2;
强势线2:=HHV(MA((((LOW+HIGH)+CLOSE)/3.18),8),20),COLORWHITE,LINETHICK2;
强势线3:=HHV(MA((((LOW+HIGH)+CLOSE)/3.258),8),10),COLORYELLOW,LINETHICK2;
强势线4:=HHV(MA((((LOW+HIGH)+CLOSE)/3.08),80),13),COLORLIMAGENTA,LINETHICK2;
开始走强1:=强势线1 REF(强势线1,1),;
开始走强2:=强势线2 REF(强势线2,1),;
开始走强3:=强势线3 REF(强势线3,1),;
开始走强4:=强势线4 REF(强势线3,1),;
双强1:=开始走强1AND开始走强2,;
双强2:=开始走强2AND开始走强3,;
双强3:=开始走强3AND开始走强4,;
三强:=开始走强1AND开始走强2AND开始走强3,;
四强:=开始走强1AND开始走强2AND开始走强3AND开始走强4,;
强势为王:=双强1OR双强2OR双强3OR三强OR四强,;
强势1:=CROSS(强势线1,强势线3),;
强势金叉2:=CROSS(强势线2,强势线4),;
强势金叉3:=CROSS(强势线3,强势线4),;
强势金叉4:=CROSS(强势线3,强势线1),;
强势金叉5:=CROSS(强势线2,强势线1),;
强势金叉6:=CROSS(强势线4,强势线1),;
强势金叉:=强势金叉1OR强势金叉2OR强势金叉3OR强势金叉4OR强势金叉5OR强势金叉6,;
三十:=MA(C,30),COLORRED,LINETHICK2;
三十而立:=三十 REF(三十,1),;
JUJ:=(HIGH+LOW+CLOSE)/3;
QUJ0:=VOL/IF(HIGH=LOW,4,HIGH-LOW);
QUJ1:=IF(CAPITAL=0,QUJ0*(JUJ-MIN(CLOSE,OPEN)),QUJ0*IF(HIGH=LOW,1,(MIN(OPEN,CLOSE)-LOW)));
QUJ2:=IF(CAPITAL=0,QUJ0*(MIN(OPEN,CLOSE)-LOW),QUJ0*IF(HIGH=LOW,1,(JUJ-MIN(CLOSE,OPEN))));
QUJ3:=IF(CAPITAL=0,QUJ0*(HIGH-MAX(OPEN,CLOSE)),QUJ0*IF(HIGH=LOW,1,(HIGH-MAX(OPEN,CLOSE))));
QUJ4:=IF(CAPITAL=0,QUJ0*(MAX(CLOSE,OPEN)-JUJ),QUJ0*IF(HIGH=LOW,1,(MAX(CLOSE,OPEN)-JUJ)));
QUJ5:=QUJ1+QUJ2;
QUJ6:=QUJ3+QUJ4;
DD:=(QUJ5-QUJ6)/(QUJ5+QUJ6)*100;
DDZ:=DD*17;
ddx:=((QUJ1+QUJ2)-(QUJ3+QUJ4))/IF(CAPITAL=0,1000000,10000);
DX:=MA(DDX,5)*20;
DDX1:=SMA(DX,3,1);
DDX2:=SMA(DDX1,3,1);
DDX3:=EMA(DDX2,5);
DDY:=((QUJ2+QUJ4)-(QUJ1+QUJ3))/IF(CAPITAL=0,1000000,10000);
DY:=MA(DDY,5)*22;
DDY1:=SMA(DY,3,1);
DDY2:=SMA(DDY1,3,1);
DDY3:=EMA(DDY2,5);
CC:=Abs(REF(CLOSE,1)-CLOSE)/CLOSE*100;
JJ:=CC 0ANDCC
AA:=DDX1 DDX2ANDDDX2 DDX3ANDDDX1 DDX3;
BB:=DDY1 DDY2ANDDDY2 DDY3ANDDDY1 DDY3;
HH:=AA 0ANDBB 0ANDDDZ 300ANDJJ
dde多头:=HH 0,COLORRED;
{多头}
成本:=EMA(AMOUNT,25)/EMA(VOL,25);
成本均线:=EMA(AMOUNT,65)/EMA(VOL,65);
成本均线:=EMA(AMOUNT,170)/EMA(VOL,170);
周成本多头:=短线成本均线 中线成本均线AND中线成本均线 长线成本均线,COLORYELLOW,LINETHICK3;
{成本多头}
C5:=EMA(AMOUNT,5)/EMA(VOL,5);
C13:=EMA(AMOUNT,13)/EMA(VOL,13);
C34:=EMA(AMOUNT,34)/EMA(VOL,34);
成本线多头排列:=C5 C13ANDC13
VV:=(C+L+H)/3;
DSA:=SMA(XMA(VV,15),2,1)LINETHICK3;
顶部1:=DSA*1.0888,COLORMAGENTA,LINETHICK1;
顶部2:=DSA*1.158,COLORBROWN,LINETHICK1;
顶部3:=DSA*1.218,COLORRED,LINETHICK1;
底部1:=DSA*0.9518,COLORLICYAN,LINETHICK1;
底部2:=DSA*0.888,COLORLIMAGENTA,LINETHICK1;
底部3:=DSA*0.8,COLORGREEN,LINETHICK1;
买:=L 底部1,;
日多波买:=成本线多头排列AND波段买,;
日多DDE金手指:=(日多波买ANDDDE多头),;
N:=C-REF(C,13);
D:=MA(N,5);
A:=POW((N-D),2);
B:=MA(A,10);
CA:=SQRT(B);
SG:=D+1*CA;
BB1:=MA(SG,3);
BB2:=MA(SG,5);
BB3:=MA(SG,8);
BB5:=MA(SG,10);
BB6:=MA(SG,12);
BB7:=MA(SG,14);
金叉1:=CROSS(SG,BB1);
金叉2:=CROSS(SG,BB2);
金叉3:=CROSS(SG,BB3);
金叉5:=CROSS(SG,BB5);
金叉6:=CROSS(SG,BB6);
金叉7:=CROSS(SG,BB7);
金叉8:=CROSS(BB1,BB3);
金叉9:=CROSS(BB1,BB5);
金叉10:=CROSS(BB1,BB6);
金叉11:=CROSS(BB1,BB7);
金叉12:=CROSS(BB2,BB6);
金叉13:=CROSS(BB2,BB7);
金叉14:=CROSS(BB3,BB6);
金叉15:=CROSS(BB3,BB7);
神仙金叉:=EVERY(金叉1OR金叉2OR金叉3OR金叉5OR金叉6OR金叉7OR金叉8
OR金叉8OR金叉9OR金叉10OR金叉11OR金叉12OR金叉13OR金叉14OR金叉15,3);
VAR1:=(C+H+O+L)/4;
卖出:=XMA(VAR1,20)*(1+80/1000),COLORGREEN,LINETHICK2;
卖出2:=XMA(VAR1,5)*(1+30/1000),COLORRED,LINETHICK2;
买入:=XMA(VAR1,32)*(1-100/1000),;
买入1:=XMA(VAR1,20)*(1-60/1000),;
买关注:=LOW 买入1,COLORWHITE,;
破黄买:=CLOSE 买入1,;
破红买:=LOW =买入,;
周多关注:=LOW 买入1AND周成本多头,;
周多破黄:=CLOSE 买入1AND周成本多头,;
周多破红:=LOW =买入AND周成本多头,;
日多破黄:=CLOSE 买入1AND成本线多头排列,COLORYELLOW;
日多破红:=CLOSE 买入AND成本线多头排列,COLORRED;
日多紧跟:=LOW =买入1AND成本线多头排列,COLORLIMAGENTA,LINETHICK2;
财神送礼1:=神仙金叉AND周多破黄,;
财神送礼2:=神仙金叉AND日多破黄,;
财神送礼3:=神仙金叉AND周多破红,;
财神送礼:=财神送礼1OR财神送礼2OR财神送礼3,LINETHICK2,COLORYELLOW;
强势财神:=强势为王AND财神送礼,;
M1:=MA(CLOSE,1);
M2:=(LOW+HIGH+CLOSE)/3;
M3:=MA(M2,5);
M4:=HHV(M3,10);
Z:=HHV((M1 M4),10)ORHHV((M1 M4),10);
S:=EMA(100*(CLOSE-LLV(LOW,34))/(HHV(HIGH,35)-LLV(LOW,34)),3);
T:=FILTER(CROSS(S,60),20);
三号主图:=COUNT(T 0,3)=1,COLORBROWN;
梦幻三号:=三号主图AND买关注,COLORRED,;
梦之金果:=梦幻三号AND强势为王AND成本线多头排列,;
A1A:=IF(CROSS(C,MA(C,3))ANDMA(C,5) REF(MA(C,5),1)ANDV REF(V,1),50,0);
X1:=CROSS(C,MA(C,10))ANDMA(C,10) MA(C,20)ANDMA(C,20) MA(C,60);
X2:=MA(C,10) REF(MA(C,10),1)ANDV REF(V,1);
A0:=IF(X1ANDX2,80,0);
半山追涨:=IF(A1AANDA0,100,0);
紫金半山追涨:=半山追涨AND破红买,;
白银半山追涨:=半山追涨AND买关注,;
A1:=SMA(CLOSE,7,1);
A2:=SMA(CLOSE,13,1);
A3:=SMA(CLOSE,25,1);
A4:=SMA(CLOSE,34,1);
停牌:=(DYNAINFO(4)=0);
AAA:=COUNT(A1 A2ANDA2 A3ANDA3 A4,4) =4ANDCOUNT(A2 REF(A2,1),80) 20ANDNOT(停牌);
BBB:=COUNT(A1 A2ANDA2 A3ANDA3 A4,4) =4ANDCOUNT(A2 REF(A2,1),200) 40ANDNOT(停牌);
CCC:=AAORBB;
开始涨:=CCCANDNOT(REF(CC,1));
波买2:=C 底部1,;
周多波买:=周成本多头AND波段买,;
坚决买:=LOW 底部2,;
周多坚决买:=周成本多头AND坚决买,;
日多坚决买:=成本线多头排列AND坚决买,;
双周波买:=周多破红AND周多波买,;
双周坚底:=周多坚决买AND周多破红,;
日双波买:=(日多破红AND日多波买)OR(日多紧跟AND日多波买),;
日破金来:=日多坚决买AND日多破红,;
向上猛冲A:=波买2AND开始涨,;
向上猛冲B:=双周波买AND开始涨,;
向上猛冲C:=双周坚底AND开始涨,;
向上猛冲D:=日双波买AND开始涨,;
向上猛冲E:=日破金来AND开始涨,;
向上猛冲:=向上猛冲AOR向上猛冲BOR向上猛冲COR向上猛冲DOR向上猛冲E,;
清仓:=1.66*MA(FORCAST(CLOSE,2),40),COLORRED;
出货:=1.36*MA(FORCAST(CLOSE,2),40),COLOR08FFFF;
高抛:=1.16*MA(FORCAST(CLOSE,2),40),COLORFF82FF;
低吸:=0.82*MA(FORCAST(CLOSE,2),40),COLORF7E300;
满仓:=0.72*MA(FORCAST(CLOSE,2),40),COLORGREEN;
强通1:=清仓 REF(清仓,1),;
强通2:=出货 REF(出货,1),;
强通3:=高抛 REF(高抛,1),;
强通4:=低吸 REF(低吸,1),;
强通5:=满仓 REF(满仓,1),;
上升通道:=强通1AND强通2AND强通3AND强通4AND强通5,;
强势低买:=强势为王ANDC DSAANDL 底部1,COLORMAGENTA,LINETHICK2,LINESTICK;
三十强低买:=L 底部1AND三十而立ANDC DSAAND上升通道,COLORRED;
三十线上买:=三十强低买ANDH 三十,STICK,LINETHICK5,COLORMAGENTA;
三十为王:=三十强低买AND强势为王,COLORYELLOW,LINETHICK3,STICK;
强波金叉1:=强势金叉AND日多波买,;
强波金叉2:=强势金叉AND双周波买,;
强波金叉3:=强势金叉AND日双波买,;
强波金叉A:=强波金叉1OR强波金叉2OR强波金叉3,COLORLIMAGENTA,LINETHICK2;
强波金叉B:=强势金叉ANDOPEN DSAAND成本线多头排列,LINETHICK2;
强波总金叉:=强波金叉AAND强波金叉B,COLORRED,STICK,LINETHICK4;
强波金叉:=强波金叉AOR强波金叉BOR强波总金叉,;
猎豹金叉:=CROSS(买入1,买入),;
强者日双波:=(强势为王AND日双波买)OR(强势为王AND双周波买),;
强者周双波:=强势为王AND双周波买,;
梦幻金叉A:=强势金叉AND买关注AND成本线多头排列,COLORYELLOW,LINETHICK2,;
梦幻金叉B:=强势金叉AND破红买AND成本线多头排列,COLORRED,LINETHICK4,STICK;
梦幻金叉C:=强势金叉AND猎豹金叉AND成本线多头排列,;
梦幻金叉:=梦幻金叉AOR梦幻金叉BOR梦幻金叉C,;
双波周日:双周波买AND日双波买,COLORGREEN,LINETHICK5,STICK;
强势双波:=日双波买ANDCLOSE 强势线2,COLORRED,LINETHICK3;
强双波共振:=双波周日共振AND强势为王,;
自己的王者剑:日多DDE金手指OR强势财神OR紫金半山追涨OR白银半山追涨OR
向上猛冲OR强者日双波OR强者周双波OR强势双波OR强势低买OR三十为王
OR强势财神OR梦之金果OR梦幻金叉OR强波金叉,COLORYELLOW,LINETHICK3;
霸王之剑:(强势为王AND自己的王者剑)OR
(三十而立AND自己的王者剑)OR百胜买点OR追涨屠牛,COLORRED,STICK,LINETHICK5;
DRAWICON(霸王之剑 0,1.1,1);
DRAWTEXT(BARPOS=SYSPARAM(2),SYSPARAM(4),'股海神偷'),colorFF;
Y4:=STRCMP(USERNAME,'天生赢家') 0ANDSTRCMP(USERNAME,'wjp') 0;
FO:=OPEN;
FH:=HIGH;
FL:=LOW;
FC:=CLOSE;
KK:=IF(FC =FOAND(FC =REF(FC,1)ORREF(FC,1) =REF(FO,1)),1,IF(FC FOAND(FC REF(FO,1)ORREF(FC,1) REF(FO,1)),-1,0));
FCFO:=FC-FO;
KKS1:=KK=1ANDFC =FOORKK=1ANDFC
FOFC:=FO-FC;
KKS2:=KK =0ANDFC =FOORKK =0ANDFC
STDS:=STD(CLOSE,N);
D:=(FO+FC)/2;
今转:=IF(KK=1,MIN(FC,FO),IF(KK=-1,MAX(FC,FO),IF(REF(KK,1)=1,MIN(FC,FO),IF(REF(KK,1)=-1,MAX(FC,FO),(FC+FO)/2))));
HL:=EMA(HIGH,5);
LL:=EMA(LOW,5);
CH:=CROSS(CLOSE,HL);
CL:=-CROSS(LL,CLOSE);
TF:=IF(CH,CH,IF(CROSS(LL,CLOSE),CL,0));
UD:=REF(TF,BARSLAST(TF));
霸王控盘线:=IF(UD 0,LL,HL);
PARTLINE(1,霸王控盘线),LINETHICK2,colorFFFF;
PARTLINE(UD=1ANDREF(UD,1)=1,LL),LINETHICK4,colorFF;
PARTLINE(UD=-1ANDREF(UD,1)=-1,HL),LINETHICK4,colorFF00;
VAR111:=UD=-1ANDREF(UD,1)=-1;
VAR112:=(CLOSE+HIGH+LOW)/3;
VAR113:=EMA(VAR112,10);
VAR114:=REF(VAR113,1);
VAR115:=VAR113-VAR114;
VAR331:=(HHV(INDEXH,21)-INDEXC)/(HHV(INDEXH,21)-LLV(INDEXL,21))*100-10;
VAR332:=(INDEXC-LLV(INDEXL,21))/(HHV(INDEXH,21)-LLV(INDEXL,21))*100;
VAR3331:=SMA(VAR332,13,8);
VAR333:=SMA(VAR3331,13,8);
M8:=EMA(CLOSE,8);
M13:=EMA(M8,13);
VAR1:=EMA(M13,62);
VAR2:=(CLOSE+HIGH+LOW)/3;
VAR3:=EMA(VAR2,10);
VAR4:=REF(VAR3,1);
VAR5:=(REF(HIGH,1)+REF(LOW,1))/2;
VAR6:=MA(CLOSE,17)+2*STD(CLOSE,17);
VAR7:=REF(CLOSE,1);
VAR8:=(SMA(MAX(CLOSE-VAR7,0),7,1))/(SMA(ABS(CLOSE-VAR7),7,1))*100;
VAR9:=CROSS(69,VAR8);
VARA:=FILTER(VAR9,4);
VARB:=(2*CLOSE+HIGH+LOW)/4;
VARC:=LLV(LOW,34);
VARD:=HHV(HIGH,34);
VARE:=EMA((VARB-VAR1)/(VAR5-VAR1)*100,7);
VARF:=EMA(0.667*REF(VARE,1)+0.333*VARE,5);
VAR10:=MA(CLOSE,80)-MA(CLOSE,10)/3;
VAR11:=REF(CLOSE,1);
VAR12:=(SMA(MAX(CLOSE-VAR11,0),N,1))/(SMA(ABS(CLOSE-VAR11),N,1))*100;
DRAWTEXTEX(1,100,0,0,'COLOR555555;
通达信霸王剑指标公式截图