通达信指标公式源码概况:
指标类别: 通达信指标公式
授权方式: 免费版
指标评级: ★★★★★
指标分类: 策略
画线方法: 副图
一、红买绿卖主图指标公式
A1:=EMA((CLOSE-LLV(LOW,5))/(HHV(HIGH,13)-LLV(LOW,10))*4,4);
A2:"DMI.PDI"(14,6)>33AND"DMI.MDI"(14,6)<10AND"DMI.ADX"(14,6)>40AND"DMI.ADXR"(14,6)>45,NODRAW;
A3:HHV(A1,4)>3.2ORA1>2.5ANDA2,NODRAW;
卖点:A3>0;
V1:=EMA(CLOSE,60)-EMA(CLOSE,300);
V2:=EMA(V1,300);
V3:=(CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8))*100;
股票买入线:SMA(V3,2,1);
股票卖出线:SMA(股票买入线,2,1);
V6:=CLOSE/REF(CLOSE,3)>=1.1;
V7:=BACKSET(V6,3);
大涨股票买:IF((V7ANDCOUNT(V7,3)=1),50,0),colormagenta,LINETHICK2;
DRAWTEXT(大涨股票买,50,'大涨股票买'),colormagenta;
V10:=PEAKBARS(3,15,1)<10;V12:=IF(V10=1,50,0);
头部:=IF(V12=50,100,0);
股票卖:IF(头部>REF(头部,1),50,0),colorgreen,LINETHICK2;
V9:=TROUGHBARS(3,15,1)<10;V11:=IF(V9=1,50,0);
底部:=IF(V11=50,50,0);
股票买:IF(底部>REF(底部,1),40,0),colorred,LINETHICK2;DRAWTEXT(股票买,40,'股票买'),coloryellow;
DIF:(EMA(C,12)-EMA(C,26)),COLORF0F0F0;
DEA:EMA(DIF,9),COLOR00DCDC;
MACD:2*(DIF-DEA),COLORSTICK;
STICKLINE(MACD>REF(MACD,1)ANDMACD>=0,MACD,0,2,0),COLORRED;
STICKLINE(MACD>REF(MACD,1)ANDMACD<0,MACD,0,2,0),COLORMAGENTA;
VA:=IF(C>REF(C,1),V,-V);
OB:=SUM(IF(C=REF(C,1),0,VA),0);
VRA:=(EMA(C,9)-EMA((REF(C,1)+O)/2,9));
AV:=VRA*EMA(OB,18)/100;
AM18:=EMA(AV,18);
AM36:=EMA(AV,36);
D1:=IF(CODELIKE('300'),0,1);
{创业板}
D2:=IF(NAMELIKE('S'),0,1);
D3:=IF(NAMELIKE('*'),0,1);
{去掉停牌}
D4:=DYNAINFO(17)>0;
去掉:=D1ANDD2ANDD3ANDD4;
股价:=C>=7.00ANDC<22;
流通盘:=CAPITAL/1000000<=9.46;
市盈率:=DYNAINFO(39)>0ANDDYNAINFO(39)<=66;
内外盘:=(DYNAINFO(23)>DYNAINFO(22))AND(DYNAINFO(7)>DYNAINFO(3));
A1:=FINANCE(43)>20ANDFINANCE(44)>10AND
FINANCE(43)>FINANCE(44)ANDFINANCE(34)>2
ANDFINANCE(1)<1000000000ANDFINANCE(30)>0
ANDFINANCE(28)>0.05*FINANCE(20);A2:=SMA(C,30,1);
A3:=REF(A2,1);
AM18>AM36ANDAV>REF(AV,1)ANDAV>0ANDA1=1ANDA2>=A3-0.01
AND流通盘AND去掉AND市盈率AND内外盘ANDDYNAINFO(17)>=1.01ANDA1
AND股价&&C/REF(C,1)>=1.015ANDFINANCE(43)>0ANDC>COST(55)ANDV>0;
VOLUME:VOL,VOLSTICK;
预测:=IF(DYNAINFO(7)=CLOSEANDDYNAINFO(10)=AMOUNT,MAX(VOL,DYNAINFO(17)*REF(MA(VOL,5),1)),0),NODRAW;
TT:=IF(ISLASTBAR,预测/VOL,1),NODRAW;
换手:=HSCOL,NODRAW,COLOR00FF00;
MA5换:SUM(HSCOL,5),NODRAW,COLOR00FFFF;
月换:SUM(HSCOL,20),NODRAW,COLORFFFF80;
V倍:VOL/REF(VOL,1),NODRAW,COLORFFFF80;
JJQ:=(HIGH+LOW+CLOSE)/3;QJ0:=VOL/IF(HIGH=LOW,4,HIGH-LOW);
QJ1:=QJ0*(MIN(OPEN,CLOSE)-LOW);
QJ2:=QJ0*(JJQ-MIN(CLOSE,OPEN));
QJ3:=QJ0*(HIGH-MAX(OPEN,CLOSE));
QJ4:=QJ0*(MAX(CLOSE,OPEN)-JJQ);
千钧DDX:IF(HIGH=LOW,4*QJ0,((QJ1+QJ2)-(QJ3+QJ4)))/SUM(VOL,10)*100,NODRAW,COLOR80FF00;
ZFA:=(C/REF(C,1)-1)*100;
ZFB1:=(C/O-1)*100;
ZF:MAX(ZFA,ZFB1),NODRAW,COLOR00FFFF;
VARA2:=LLV(MA(LOW,3),3);
VARA3:=HHV(MA(HIGH,3),3);
NN1:=120;
HH:=HHV(V*TT,NN1);
LL:=LLV(V,NN1);
最高:=CONST(HH);
最低:=CONST(LL);
RCC:=最高*0.9-(最高-最低)*0.5;
RHL:=RCC;
HLMAX:=最高;
HLMIN:=最低;
HLMN1:=(HLMAX+HLMIN)/2;
HLMN2:=HLMAX-HLMIN;
HLMN3:=(100-0)/2*1.3;
HLMN4:=(100-0)/1*1.3;
P:=最高/120;
神:=2*SMA(V*((C+L)/2+(H+C)/2+L)/3,2,1)/SMA(V,2,1)-(3*HHV(SMA(V*((C+L)/2+(H+C)/2+L)/3,2,1)/SMA(V,2,1),2)-2*SMA(V*((C+L)/2+(H+C)/2+L)/3,2,1)/SMA(V,2,1));
奇:=(2*神+EMA((2*(C+L)/2+(H+C)/2+L+O)/5,2)+2*((EMA((C*2+H+L+O)/5,5)+MA((C*2+H+L+O)/5,13)+MA((C*2+H+L+O)/5,21))/3)+((EMA
((C*2+H+L+O)/5,13)+MA((C*2+H+L+O)/5,21)+MA((C*2+H+L+O)/5,34))/3)+((EMA((C*2+H+L+O)/5,21)+MA((C*2+H+L+O)/5,34)+MA((C*2+H+L+O)/5,55))/3))/7;
分清:=(FORCAST(HHV((C+L)/2,1),21)+(EMA(((C+L)/2+L+(H+C)/2)/3,55)-(C-EMA(((C+L)/2+L+(H+C)/2)/3,55))))/2;
放心买入:=(((C+L)/2+(H+C)/2+L)/3+(3*(C+H+L+(O+C+L)/3)/4-2*(C+L)/2))/2;
强:=(EMA((分清+3*((EMA(放心买入,5)*5+分清)/6+((EMA(奇,5)+EMA(奇,8)+EMA(奇,13))/3))/2)/4,3)/3),POINTDOT,COLOR00FFFF;
验证:=((((C+L)/2-LLV(L,24))/(HHV((H+C)/2,24)-LLV(L,24))*1.1*(C+L)/2));
续持验证:=EMA((2*(5*((EMA((2*C+L)/3,2)-EMA((2*C+H)/3,5))
-EMA((EMA((2*C+L)/3,2)-EMA((2*C+H)/3,5)),21)))
+(((C*2+H)/3+(C*2+H)/3)/2)+EMA(验证,2))/4,2),COLOR555555;
比:=TT;
昨V:=TT;
T:=IF(ISLASTBAR,IF(FROMOPEN>60,IF(FROMOPEN-INTPART(FROMOPEN/60)*60=0,1,
60/(FROMOPEN-INTPART(FROMOPEN/60)*60)),60/FROMOPEN),1);
WJ:=(H+L+C)/3;
V1:=IF(H=L,1,H-MAX(O,C));
V2:=IF(H=L,1,MAX(C,O)-WJ);
V3:=IF(H=L,1,MIN(O,C)-L);
V4:=IF(H=L,1,WJ-MIN(C,O));
V5:=VOL/IF(H=L,4,H-L);
V6:=(V1*V5);
V7:=(V2*V5);
V8:=(V3*V5);
V9:=(V4*V5);
买盘1:=DYNAINFO(23)*比;
卖盘1:=DYNAINFO(22)*比;
买盘2:=IF(ISLASTBARANDC>300,(V9+V8)*TT,(V9+V8));
卖盘2:=IF(ISLASTBARANDC>300,(V6+V7)*TT,(V6+V7));
买盘A:=IF(ISLASTBARANDPERIOD=5ANDC<300,买盘1,买盘2);
卖盘A:=IF(ISLASTBARANDPERIOD=5ANDC<300,卖盘1,卖盘2);
AA:=VOL/((HIGH-LOW)*2-ABS(CLOSE-OPEN));
主买:=IF(CLOSE>OPEN,AA*(HIGH-LOW),IF(CLOSE<OPEN,AA*((HIGH-OPEN)+(CLOSE-LOW)),VOL/2)),POINTDOT,COLORRED;
主卖:=IF(CLOSE>OPEN,0-AA*((HIGH-CLOSE)+(OPEN-LOW)),IF(CLOSE<OPEN,0-AA*(HIGH-LOW),0-VOL/2)),LINETHICK0,COLORGREEN;
净流:主买-主卖,NODRAW,COLOR4080FF;VOL,VOLSTICK;
ZLCM1:=EMA(WINNER(CLOSE)*70,3);{//主力筹码估算}
SHCM:=EMA((WINNER(CLOSE*1.1)-WINNER(CLOSE*0.9))*80,3);{//散户筹码估算}
ZZLKP:=ZLCM1/(ZLCM1+SHCM);{//主力控盘筹码比率}
ZZLJJ:=EMA(ZZLKP,89);{//主力警戒}
DD1:=EMA((O+H+L)/3,4)COLORWHITE,NODRAW;
DD2:=EMA(C+(H-L)*0.618,3)COLORYELLOW,NODRAW;
密码1:=DD2+(DD2-DD1)*0.618,NODRAW,COLORWHITE;{明卖}
密码2:=EMA((O+H+L)/3,4)+((H+L)/2-REF((O+H+L)/3,3))/4,NODRAW;{明买}
密码3:=MA(REF(密码1,1),1)*1,COLORLIMAGENTA,NODRAW;{今卖}
密码4:=REF(密码2,1),COLORLIMAGENTA,NODRAW;{今买}
密码5:=MA(REF(DD2,1),1)*1,COLORLIMAGENTA,NODRAW;{今卖}
密码6:=REF(DD1,1),COLORLIMAGENTA,NODRAW;{今买}
STICKLINE(1,HLMAX,HLMAX*0.96,5,0),COLORGREEN;
红灯买:STICKLINE(密码1>密码3,HLMAX,HLMAX*0.96,5,0),COLORRED;
STICKLINE(1,HLMAX*0.98,HLMAX*0.98,5,0),COLORWHITE;
STICKLINE(1,HLMAX*0.93,HLMAX*0.89,5,0),COLORRED;
绿灯卖:STICKLINE(密码2<=密码4,HLMAX*0.93,HLMAX*0.89,5,0),COLORGREEN;
STICKLINE(1,HLMAX*0.91,HLMAX*0.91,5,0),COLORWHITE;
操作段1:STICKLINE(密码1>(密码3)ANDC>密码2OR密码2>密码4,HLMAX*0.82,HLMAX*0.86,5,0),COLORRED;
操作段2:STICKLINE(C>密码2AND密码1>密码3,HLMAX*0.82,HLMAX*0.86,5,0),COLORMAGENTA;
操作段3:STICKLINE(密码1<密码3AND密码2>密码4,HLMAX*0.82,HLMAX*0.86,5,0),COLORYELLOW;
STICKLINE(密码1>(密码3)ANDC>密码2OR密码2>密码4ORC>密码2AND密码1>密码3,HLMAX*0.84,HLMAX*0.84,5,0),COLORWHITE;
IF(ZZLJJ<REF(ZZLJJ,1),-35*P,DRAWNULL),CIRCLEDOT,COLOR00FF00,LINETHICK1;
IF(ZZLJJ>REF(ZZLJJ,1),-35*P,DRAWNULL),CIRCLEDOT,COLORRED,LINETHICK1;
IF(续持验证<强,-5*P,DRAWNULL),CIRCLEDOT,COLOR00FF00,LINETHICK1;
IF(续持验证>=强,-5*P,DRAWNULL),CIRCLEDOT,COLORRED,LINETHICK1;
IF(续持验证>=REF(续持验证,1),-11*P,DRAWNULL),CIRCLEDOT,COLORRED,LINETHICK1;
IF(续持验证<REF(续持验证,1),-11*P,DRAWNULL),CIRCLEDOT,COLOR00FF00,LINETHICK1;
IF(ZF<0,-17*P,DRAWNULL),CIRCLEDOT,COLOR00FF00,LINETHICK1;
IF(ZF>0,-17*P,DRAWNULL),CIRCLEDOT,COLORRED,LINETHICK1;
IF(千钧DDX<0,-23*P,DRAWNULL),CIRCLEDOT,COLOR00FF00,LINETHICK1;
IF(千钧DDX>0,-23*P,DRAWNULL),CIRCLEDOT,COLORRED,LINETHICK1;
个股资金线:=MA(C,1)/MA(REF(C,18),18)*100;
资金生命线:=MA(FORCAST(个股资金线,20),6);
生命线:个股资金线>资金生命线,COLOR000000,STICK,LINETHICK1;
IF(生命线<=0,-29*P,DRAWNULL),CIRCLEDOT,COLOR00FF00,LINETHICK1;
IF(生命线>0,-29*P,DRAWNULL),CIRCLEDOT,COLORRED,LINETHICK1;
CC:=CLOSE;
WW:=(CC-LOW+0.01)/(HIGH-LOW+0.01);
N120:=IF(BARSSINCE(CLOSE>0)<120,BARSSINCE(CLOSE>0),120);
N90:=IF(BARSSINCE(CLOSE>0)<90,BARSSINCE(CLOSE>0),90);
N55:=IF(BARSSINCE(CLOSE>0)<55,BARSSINCE(CLOSE>0),55);
N34:=IF(BARSSINCE(CLOSE>0)<34,BARSSINCE(CLOSE>0),34);
ZLCMA:=(DMA(WW,VOL/(MA(VOL,N120)*N120))+DMA(WW,VOL/(MA(VOL,N90)*N90))+DMA(WW,VOL/(MA(VOL,N55)*N55))+DMA(WW,VOL/(MA(VOL,N34)*N34)))/4*800;
NN:=IF(PERIOD=5,240,IF(PERIOD=6,360,240));
ZLCMC:=(ZLCMA-LLV(ZLCMA,NN))*100/(HHV(ZLCMA,NN)-LLV(ZLCMA,NN));
ZLCMB:=WINNER(CLOSE)*100;
ZLB:=IF(ZLCMB>0,ZLCMB,DRAWNULL);
ZLCM:=IF(ZLB=DRAWNULL,ZLCMC,ZLCMB);
ZLQS:EMA(ZLCM,3),COLORYELLOW;
BBCM:=ZLQS-REF(ZLQS,1);
IF(BBCM<0,-35*P,DRAWNULL),CIRCLEDOT,COLOR00FF00,LINETHICK1;
IF(BBCM>0,-35*P,DRAWNULL),CIRCLEDOT,COLORRED,LINETHICK1;
VAR2:=(HIGH-LOW);
VAR3:=ABS((OPEN-CLOSE));
VAR4:=(HIGH-IF((CLOSE>OPEN),CLOSE,OPEN));
VAR5:=(IF((CLOSE>OPEN),OPEN,CLOSE)-LOW);
VAR6:=((VAR3/VAR2)*VOL);
VAR7:=((VAR4/VAR2)*VOL);
VAR8:=((VAR5/VAR2)*VOL);
VAR9:=IF(((VOL/CAPITAL)>0.001),1,EXP(ABS(LOG(((VOL/CAPITAL)*100)))));
多头:STICKLINE((CLOSE>MA(CLOSE,30)),0,VOL,3,0),COLOR000088;
STICKLINE((CLOSE>MA(CLOSE,30)),0,VOL,2,0),COLOR0000AA;
STICKLINE((CLOSE>MA(CLOSE,30)),0,VOL,1,0),COLOR0000DD;
STICKLINE((CLOSE>MA(CLOSE,30)),0,VOL,0.5,0),COLOR0000FF;
空头:STICKLINE((CLOSE<MA(CLOSE,30)),0,VOL,3,0),COLOR008800;
STICKLINE((CLOSE<MA(CLOSE,30)),0,VOL,2,0),COLOR00AA00;
STICKLINE((CLOSE<MA(CLOSE,30)),0,VOL,1,0),COLOR00DD00;
STICKLINE((CLOSE<MA(CLOSE,30)),0,VOL,0.5,0),COLOR00FF00;
加仓:STICKLINE((((VAR6>=VAR7)AND(VAR6>=VAR8))
AND(CLOSE>OPEN)),0,VAR6,3,0),COLOR880088;
STICKLINE((((VAR6>=VAR7)AND(VAR6>=VAR8))
AND(CLOSE>OPEN)),0,VAR6,2,0),COLORAA00AA;
STICKLINE((((VAR6>=VAR7)AND(VAR6>=VAR8))
AND(CLOSE>OPEN)),0,VAR6,1,0),COLORDD00DD;
STICKLINE((((VAR6>=VAR7)AND(VAR6>=VAR8))
AND(CLOSE>OPEN)),0,VAR6,0.5,0),COLORFF00FF;
减仓:STICKLINE((((VAR6>=VAR7)AND(VAR6>=VAR8))
AND(CLOSE<OPEN)),0,VAR6,3,0),COLOR880000;
STICKLINE((((VAR6>=VAR7)AND(VAR6>=VAR8))
AND(CLOSE<OPEN)),0,VAR6,2,0),COLORBB0000;
STICKLINE((((VAR6>=VAR7)AND(VAR6>=VAR8))
AND(CLOSE<OPEN)),0,VAR6,1,0),COLORDD0000;
STICKLINE((((VAR6>=VAR7)AND(VAR6>=VAR8))
AND(CLOSE<OPEN)),0,VAR6,0.5,0),COLORFF0000;
洗盘:STICKLINE(((VAR8>VAR6)AND(VAR8>VAR7)),0,VAR8,3,0),COLOR999999;
STICKLINE(((VAR8>VAR6)AND(VAR8>VAR7)),0,VAR8,2,0),COLORAAAAAA;
STICKLINE(((VAR8>VAR6)AND(VAR8>VAR7)),0,VAR8,1,0),COLORDDDDDD;
STICKLINE(((VAR8>VAR6)AND(VAR8>VAR7)),0,VAR8,0.6,0),COLORFFFFFF;
高卖:STICKLINE(((VAR7>VAR6)AND(VAR7>VAR8)),0,VAR7,3,0),COLOR008888;
STICKLINE(((VAR7>VAR6)AND(VAR7>VAR8)),0,VAR7,2,0),COLOR00AAAA;
STICKLINE(((VAR7>VAR6)AND(VAR7>VAR8)),0,VAR7,1,0),COLOR00DDDD;
STICKLINE(((VAR7>VAR6)AND(VAR7>VAR8)),0,VAR7,0.5,0),COLOR00FFFF;
B1:=(买盘A+卖盘A)<MA(V,60)/3;
B2:=MA(V,5)/2>VANDV>B1;
((80-HLMN3)*HLMN2/HLMN4+HLMN1),COLORCCCCCC,LINETHICK1,DOTLINE;
((50-HLMN3)*HLMN2/HLMN4+HLMN1),COLORCCCCCC,LINETHICK1,DOTLINE;
((20-HLMN3)*HLMN2/HLMN4+HLMN1),COLORCCCCCC,LINETHICK1,DOTLINE;
((10-HLMN3)*HLMN2/HLMN4+HLMN1),COLORCCCCCC,LINETHICK1;
KA:=(EMA((CLOSE-VARA2)/(VARA3-VARA2)*100,4)-50)*0.5+50;
DB:=EMA(0.667*REF(KA,1)+0.333*KA,2);
JJ:=3*KA-2*DB;
((KA-HLMN3)*HLMN2/HLMN4+HLMN1),COLORFFF111,LINETHICK1;
((DB-HLMN3)*HLMN2/HLMN4+HLMN1),COLOR00FF00,LINETHICK1;
((JJ-HLMN3)*HLMN2/HLMN4+HLMN1),COLORFF00FF,LINETHICK1;
DRAWTEXT_FIX(1,0.01,0.24,0,'【白洗盘进】__【黄高抛低吸】__【粉庄进追】__【兰绿庄撤卖】'),COLORFFFF00;
DRAWICON(V>=3*REF(V,1)ANDO<C,V*1.1,23);
DRAWICON(V>=2*REF(V,1)ANDO<C,V*0.8,25);
N:=10;M:=30;
VA:=IF(CLOSE>REF(CLOSE,1),VOL,-VOL);
OBV:SUM(IF(CLOSE=REF(CLOSE,1),0,VA),0);
OBV1:MA(OBV,N);
OBV2:MA(OBV,M);
五十成本集中:=(COST(75)-COST(25))/(COST(75)+COST(25))*100;
成本价1:=COST(五十成本集中),COLORGREEN;
五十成本集中1:=100-五十成本集中;
成本价2:=COST(五十成本集中1),COLORBLUE;
单峰密集价:成本价2/成本价1-1,STICK;
红:=REF(单峰密集价,1)<单峰密集价AND成本价2>REF(成本价2,1);
绿:=REF(单峰密集价,1)>单峰密集价;
主力筹码:=单峰密集价<=0.25;
底部:=(COST(95)-COST(5))/(COST(95)+COST(5))*100;
底部成本价:=COST(底部),COLORYELLOW;
顶部:=100-底部;
顶部成本价:=COST(顶部),COLORGREEN;
均值:=(底部+顶部)/2;
均值成本:=COST(均值),COLORLICYAN,DOTLINE;
STICKLINE(红,单峰密集价,0,2.8,0),COLOR000055;
STICKLINE(红,单峰密集价,0,2,0),COLOR000088;
STICKLINE(红,单峰密集价,0,1.5,0),COLOR0000AA;
STICKLINE(红,单峰密集价,0,1,0),COLOR0000CC;
STICKLINE(红,单峰密集价,0,0.5,0),COLOR0000EE;
STICKLINE(红,单峰密集价,0,0,0),COLORFFFFFF;
底:=REF(单峰密集价,2)<REF(单峰密集价,1)AND单峰密集价<REF(单峰密集价,1)AND均值成本<REF(均值成本,1);
STICKLINE(底,单峰密集价,0,0,0),COLORGREEN;
STICKLINE(底,单峰密集价,0,2.8,0),COLOR009900;
STICKLINE(底,单峰密集价,0,2,0),COLOR00BB00;
STICKLINE(底,单峰密集价,0,1.5,0),COLOR00DD00;
STICKLINE(底,单峰密集价,0,0.5,0),COLOR00FF00;
顶:=REF(单峰密集价,2)<REF(单峰密集价,1)AND单峰密集价<REF(单峰密集价,1)AND均值成本>REF(均值成本,1);
STICKLINE(顶,单峰密集价,0,2,0),COLORYELLOW;
买点1:CROSS(OBV,OBV2)ANDSUM(OBV,20)<SUM(OBV2,20),COLORGREEN,NODRAW;
DRAWICON(买点1,OBV2,27);
买点2:CROSS(OBV1,OBV2),COLORMAGENTA,NODRAW;
DRAWICON(买点2,OBV2,25);
二、红买蓝卖指标公式
TYP:=(HIGH+LOW+CLOSE)/3;
CCI:(TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14));
XF:IF(CCI>=100,CCI,100),COLORRED,LINETHICK2;
XA:IF(CCI<=-100,CCI,-100),COLORGREEN,LINETHICK2;
快卖:IF(PEAKBARS(3,15,1)=1,100,0),COLORRED,LINETHICK5;{有未来只做参考}
快买:IF(TROUGHBARS(3,15,1)=0ANDHIGH>LOW+0.01,-120,0),COLORYELLOW,LINETHICK5;{有未来只做参考}
STICKLINE(CCI<-150,CCI,-150,10,0),COLOR0000BB;
STICKLINE(C>0,-150,-151,6,0),COLORBLUE;
STICKLINE(CCI>150,CCI,150,10,0),COLOR0000BB;
STICKLINE(C>0,150,151,6,0),COLORBLUE;
{参数n14,m6}
TR:=EXPMEMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(REF(CLOSE,1)-LOW)),N);
HD:=HIGH-REF(HIGH,1);
LD:=REF(LOW,1)-LOW;
DMP:=EXPMEMA(IF(HD>0&&HD>LD,HD,0),N);
DMM:=EXPMEMA(IF(LD>0&&LD>HD,LD,0),N);
PDI:DMP*100/TR;
MDI:DMM*100/TR;
ADX:EXPMEMA(ABS(MDI-PDI)/(MDI+PDI)*100,M);
穿破短底:16;
线上发飙:30;
DIF:(EMA(CLOSE,12)-EMA(CLOSE,26))*100,COLORGREEN,LINETHICK1;
IF(DIF>=REF(DIF,1),DIF,DRAWNULL),COLORRED,LINETHICK2;
IF(DIF,5,DRAWNULL),COLORYELLOW,LINETHICK9;
IF(DIF>=REF(DIF,1),5,DRAWNULL),COLORRED,LINETHICK9;
IF(DIF<=REF(DIF,1),5,DRAWNULL),COLORGREEN,LINETHICK9;
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,9,1);
D:=SMA(K,9,1);
J:3*K-2*D,COLORLIBLUE,LINETHICK1;
IF(J>=REF(J,1),J,DRAWNULL),COLORMAGENTA,LINETHICK2;
IF(J,10,DRAWNULL),COLORYELLOW,LINETHICK9;
IF(J>=REF(J,1),10,DRAWNULL),COLORRED,LINETHICK9;
IF(J<=REF(J,1),10,DRAWNULL),COLORGREEN,LINETHICK9;
MA5:=MA(C,5),COLORLIBLUE,LINETHICK1;
IF(MA5,15,DRAWNULL),COLORYELLOW,LINETHICK9;
IF(MA(C,5)>=REF(MA(C,5),1),15,DRAWNULL),COLORRED,LINETHICK9;
IF(MA(C,5)<REF(MA(C,5),1),15,DRAWNULL),COLORGREEN,LINETHICK9;
SHORT:=12;
LONG:=26;
M:=9;
DIFF:=EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:=EMA(DIFF,M);
MACD:=2*(DIFF-DEA);
MACD金叉:=CROSS(DIFF,DEA);
金叉天数:=BARSLAST(MACD金叉);
MCAD持续走红:=LLV(MACD,金叉天数)>=0.0;
MCAD最大红柱:=HHV(MACD,金叉天数);
最大红柱天数:=BARSLAST(MCAD最大红柱);
MCAD二波:=REF(MACD,1)<=REF(MACD,2)ANDMACD>=REF(MACD,1);
MA60:=MA(C,60);
均线多头:=C>=MA(C,5)ANDC>MA(C,30)ANDC>MA60ANDMA60>REF(MA60,1);
ENTERLONG:MCAD持续走红ANDMCAD二波ANDC>=MA(C,5);
EXITLONG:CROSS(0,MACD);
N:=23;
VAR1:=(100-100/(1+SUM(VOL,N)/CAPITAL))*CAPITAL*96/10000;
LNC:=VAR1*CLOSE;
B1:=REF(LNC,1);B2:=REF(LNC,2);
SS:=IF(LNC>REF(LNC,1)ANDREF(LNC,1)>=REF(LNC,2),1,IF(LNC<REF(LNC,1)ANDREF(LNC,1)<=REF(LNC,2),-1,IF(LNC>REF(LNC,2)ANDREF(LNC,2)>REF(LNC,1),2,IF(LNC<REF(LNC,2)ANDREF(LNC,2)<REF(LNC,1),-2,0))));
SM:=IF(REF(SS,1)>0,REF(SS,1),IF(REF(SS,2)>0,REF(SS,2),IF(REF(SS,3)>0,REF(SS,3),IF(REF(SS,4)>0,REF(SS,4),IF(REF(SS,5)>0,REF(SS,5),IF(REF(SS,6)>0,REF(SS,6),IF(REF(SS,7)>0,REF(SS,7),0)))))));
MC:=IF(REF(SS,1)>0,B2,IF(SM>0,MIN(B1,B2),MAX(B1,B2))),COLORFF00FF;
SS1:=IF(LNC>REF(LNC,1)ANDREF(LNC,1)>=REF(LNC,2),1,IF(LNC<REF(LNC,1)ANDREF(LNC,1)<=REF(LNC,2),-1,IF(LNC>REF(LNC,2)ANDREF(LNC,2)>REF(LNC,1),2,IF(LNC<REF(LNC,2)ANDREF(LNC,2)<REF(LNC,1),-2,0))));
SM1:=IF(REF(SS,1)<0,REF(SS,1),IF(REF(SS,2)<0,REF(SS,2),IF(REF(SS,3)<0,REF(SS,3),IF(REF(SS,4)<0,REF(SS,4),IF(REF(SS,5)<0,REF(SS,5),IF(REF(SS,6)<0,REF(SS,6),IF(REF(SS,7)<0,REF(SS,7),0)))))));
MC1:=IF(REF(SS,1)<0,B2,IF(SM>0,MIN(B1,B2),MAX(B1,B2))),COLORFF00FF;
A:MA(SQRT(MC),1),COLORFF9933,LINETHICK2;
IF(A>=REF(A,1),A,DRAWNULL),COLORRED,LINETHICK4;
IF(A<REF(A,1),A,DRAWNULL),COLORFF9933,LINETHICK2;
A1:MA(SQRT(MC1),5),COLOR33FF33,LINETHICK2;
IF(A1>=REF(A1,1),A1,DRAWNULL),COLORFF00FF,LINETHICK3;
IF(A1<REF(A1,1),A1,DRAWNULL),COLOR33FF33,LINETHICK2;
IF(A1>REF(A1,1),A1,DRAWNULL),COLOR00FFFF,POINTDOT,LINETHICK5;
N1:=9;
DRAWKLINE(H,O,L,C);
Z1:=STRCAT(HYBLOCK,'');
Z2:=STRCAT(Z1,DYBLOCK);
Z3:=STRCAT(Z2,'');
LC:=REF(CLOSE,1);
RSI:=SMA(MAX(CLOSE-LC,0),N1,1)/SMA(ABS(CLOSE-LC),N1,1)*100;
STICKLINE((REF(RSI,1)>=80ANDRSI<80),HIGH+0.8,HIGH+1.1,0.8,0),COLORGREEN;
STICKLINE((REF(RSI,1)>=80ANDRSI<80),CLOSE+0.8,CLOSE+1.1,4,0),COLORGREEN;
STICKLINE((REF(RSI,1)<=20ANDRSI>20),LOW-0.5,LOW-0.8,0.8,0),COLORBLUE;
STICKLINE((REF(RSI,1)<=20ANDRSI>20),OPEN-0.5,OPEN-0.8,8,0),COLORBLUE;
[源码注释]通达信公式动态翻译结果
BK赋值:如果属于某板块,返回0.2,否则返回如果属于某板块,返回0.2,否则返回如果属于某板块,返回0.05,否则返回0.1
当满足条件(收盘价>=计算涨停价ANDC=最高价)时,在收盘价和开盘价位置之间画柱状线,宽度为2.7,0不为0则画空心柱.,COLORFF00FF
当满足条件(收盘价<=计算跌停价ANDC=最低价)时,在收盘价和开盘价位置之间画柱状线,宽度为2.7,0不为0则画空心柱.,COLOR80FF00
推荐阅读:红买绿卖技术指标
A1:=EMA((CLOSE-LLV(LOW,5))/(HHV(HIGH,13)-LLV(LOW,10))*4,4);
A2:="DMI.PDI"(14,6)<5AND"DMI.MDI"(14,6)>40AND"DMI.ADX"(14,6)>40
AND"DMI.ADXR"(14,6)>45ANDCROSS("DMI.ADXR","DMI.MDI");
DMI买点:(LLV(A1,4)<0.5ORA1<0.5)ANDA2;
N:=23;
VAR1:=(100-100/(1+SUM(VOL,N)/CAPITAL))*CAPITAL*96/10000;
LNC:=VAR1*CLOSE;
B1:=REF(LNC,1);B2:=REF(LNC,2);
SS:=IF(LNC>REF(LNC,1)ANDREF(LNC,1)>=REF(LNC,2),1,IF(LNC<REF(LNC,1)ANDREF(LNC,1)<=REF(LNC,2),-1,IF(LNC>REF(LNC,2)ANDREF(LNC,2)>REF(LNC,1),2,IF(LNC<REF(LNC,2)ANDREF(LNC,2)<REF(LNC,1),-2,0))));
SM:=IF(REF(SS,1)>0,REF(SS,1),IF(REF(SS,2)>0,REF(SS,2),IF(REF(SS,3)>0,REF(SS,3),IF(REF(SS,4)>0,REF(SS,4),IF(REF(SS,5)>0,REF(SS,5),IF(REF(SS,6)>0,REF(SS,6),IF(REF(SS,7)>0,REF(SS,7),0)))))));
MC:=IF(REF(SS,1)>0,B2,IF(SM>0,MIN(B1,B2),MAX(B1,B2))),COLORFF00FF;
SS1:=IF(LNC>REF(LNC,1)ANDREF(LNC,1)>=REF(LNC,2),1,IF(LNC<REF(LNC,1)ANDREF(LNC,1)<=REF(LNC,2),-1,IF(LNC>REF(LNC,2)ANDREF(LNC,2)>REF(LNC,1),2,IF(LNC<REF(LNC,2)ANDREF(LNC,2)<REF(LNC,1),-2,0))));
SM1:=IF(REF(SS,1)<0,REF(SS,1),IF(REF(SS,2)<0,REF(SS,2),IF(REF(SS,3)<0,REF(SS,3),IF(REF(SS,4)<0,REF(SS,4),IF(REF(SS,5)<0,REF(SS,5),IF(REF(SS,6)<0,REF(SS,6),IF(REF(SS,7)<0,REF(SS,7),0)))))));
MC1:=IF(REF(SS,1)<0,B2,IF(SM>0,MIN(B1,B2),MAX(B1,B2))),COLORFF00FF;
A:MA(SQRT(MC),1),COLORFF9933,LINETHICK2;
IF(A>=REF(A,1),A,DRAWNULL),COLORRED,LINETHICK4;
IF(A<REF(A,1),A,DRAWNULL),COLORFF9933,LINETHICK2;
A1:MA(SQRT(MC1),5),COLOR33FF33,LINETHICK2;
IF(A1>=REF(A1,1),A1,DRAWNULL),COLORFF00FF,LINETHICK3;
IF(A1<REF(A1,1),A1,DRAWNULL),COLOR33FF33,LINETHICK2;
IF(A1>REF(A1,1),A1,DRAWNULL),COLOR00FFFF,POINTDOT,LINETHICK5;
VOLUME:VOL,VOLSTICK;
主力启动线:MA(VOLUME,5),COLORRED,LINETHICK2;
主力洗盘线:MA(VOLUME,35),COLORYELLOW,LINETHICK2;
资金异动线:MA(VOLUME,135),COLORBLUE,LINETHICK2;
出击:STICKLINE(CROSS(主力启动线,资金异动线)OR((主力洗盘线>资金异动线)ANDCROSS(主力启动线,主力洗盘线)),0,VOL,2,0),COLORYELLOW;
启动:STICKLINE(主力启动线>REF(主力启动线,1)AND(CROSS(VOL,主力启动线)AND(REF(VOL,1)<REF(资金异动线,1)ORREF(VOL,2)<REF(资金异动线,2))),0,VOL,3,0),COLORGREEN;
V1:=CLOSE/REF(CLOSE,3)>=1.1;
V2:=BACKSET(V1,2);
V3:=REF(CLOSE,3)*1.1;
V4:=CROSS(C,V3);
OK:STICKLINE((V2ANDCOUNT(V2,2)=1),VOL,0,5,0),COLORRED;
COND:(CROSS(主力启动线,资金异动线)OR((主力洗盘线>资金异动线)ANDCROSS(主力启动线,主力洗盘线)))
OR(主力启动线>REF(主力启动线,1)AND(CROSS(VOL,主力启动线)AND(REF(VOL,1)<REF(资金异动线,1)ORREF(VOL,2)<REF(资金异动线,2))))
OR(V2ANDCOUNT(V2,2)=1),LINETHICK0;
A:=MA(-100*(HHV(HIGH,34)-CLOSE)/(HHV(HIGH,34)-LLV(LOW,34)),19);
B:=-100*(HHV(HIGH,14)-CLOSE)/(HHV(HIGH,14)-LLV(LOW,14));
D:=EMA(-100*(HHV(HIGH,34)-CLOSE)/(HHV(HIGH,34)-LLV(LOW,34)),4);
长期线:=A+100;
短期线:=B+100;
中期线:=D+100;
见顶:=((REF(中期线,1)>85ANDREF(短期线,1)>85ANDREF(长期线,1)>65)ANDCROSS(长期线,短期线));
顶部区域:=(中期线<REF(中期线,1)ANDREF(中期线,1)>80)AND(REF(短期线,1)>95ORREF(短期线,2)>95)AND长期线>60AND短期线<83.5
AND短期线<中期线AND短期线<长期线+4;
顶部:=FILTER(顶部区域,4);
STICKLINE({见顶OR}顶部,VOL,VOL*1.1,20,1),COLORBLUE,LINETHICK2;
VAR6:=REF(CLOSE,1);
VAR7:=SMA(MAX(CLOSE-VAR6,0),6,1)/SMA(ABS(CLOSE-VAR6),6,1)*100;
STICKLINE(CROSS(84,VAR7),VOL,VOL*1.05,20,1),COLOR0099FF,LINETHICK2;
均势一:=(((((((((CLOSE+REF(CLOSE,1))+REF(CLOSE,2))+REF(CLOSE,3))+REF(CLOSE,4))+REF(CLOSE,5))+REF(CLOSE,6))+REF(CLOSE,7))+REF(CLOSE,8))/9);
均势二:=((((CLOSE+REF(CLOSE,1))+REF(CLOSE,2))+REF(CLOSE,3))/4);
趋势一:=((((均势一-REF(均势一,1))/REF(均势一,1))*1000)+50);
趋势二:=((((均势二-REF(均势二,1))/REF(均势二,1))*1000)+50);
波段高位:=(CROSS(趋势一,趋势二)AND(COUNT((CLOSE>REF(HIGH,1)),12)>5));
STICKLINE(波段高位,VOL,VOL*1.08,20,1),COLORGREEN,LINETHICK2;
MA5:MA(C,5),COLORWHITE;
MA10:MA(C,10),COLORBLUE;
MA30:MA(C,21),COLORRED;
VAR1:=(MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4;
VAR2:=MA(VAR1,5);
VAR3:=MA(VAR1,10);
股海明灯:DRAWTEXT(FILTER(MA(VAR1,10)<VAR2,1),VAR3,'!'),COLORWHITE;
空方敌机:DRAWTEXT(FILTER(MA(VAR1,10)>=VAR1,1),VAR3,'~'),COLORGREEN;
X1:=(C+L+H)/3;
X2:=EMA(X1,6);
X3:=EMA(X2,5);
STICKLINE(X2>=X3,LOW,HIGH,0.1,1),COLORRED;
STICKLINE(X2>=X3,CLOSE,OPEN,3,1),COLORRED;
STICKLINE(X2<X3,LOW,HIGH,0.1,1),COLORGREEN;
STICKLINE(X2<X3,CLOSE,OPEN,3,1),COLORGREEN;
STICKLINE(CROSS(X2,X3),OPEN,CLOSE,4,0),COLORYELLOW;
STICKLINE(CROSS(X3,X2),OPEN,CLOSE,4,0),COLORBLUE;
VAR1A:=REF(CLOSE,1);
VAR2A:=SUM(VOL,2)/((HHV(HIGH,2)-LLV(LOW,2))*100);
VAR3A:=(CLOSE-VAR1A)*VAR2A;
VAR4:=SUM(VAR3A,0);
VAR5:=SMA(VAR4,5,1);
VAR6:=SMA(VAR4,8,1);
OSC:=VAR5-VAR6;
OSCMA:=MA(OSC,4);
VD:=SUM(IF(OSC>0,OSC*1.003,OSC*1.003>0),34)/34;
VE:=SUM(IF(OSC<=0,OSC*0.97,OSC*0.97<0),34)/34;
VARW:=(C/REF(C,1)-1)*100<=4;
DRAWTEXT(CROSS(OSC,VD)ANDVARW,L-0.1,'∧\N加仓'),COLORRED;
KOH:=L>REF(H,1);
KOL:=H<REF(L,1);
HIF:=L>REF(H,BARSLAST(KOH)+1);
NHIF:=L<=REF(H,BARSLAST(KOH)+1);
LIF:=H<REF(L,BARSLAST(KOL)+1);
NLIF:=H>=REF(L,BARSLAST(KOL)+1);
DRAWICON(HIFANDBARSLAST(KOH)<BARSLAST(NHIF)ANDBARSLAST(HIF)<BARSLAST(NHIF),REF(H,BARSLAST(KOH)+1),1);
DRAWICON(LIFANDBARSLAST(KOL)<BARSLAST(NLIF)ANDBARSLAST(LIF)<BARSLAST(NLIF),REF(L,BARSLAST(KOL)+1),2);
M1:=13;
M2:=5;
MA1:MA(CLOSE,M1);{设定均线}
MA2:=MA(CLOSE,M2);{设定均线}
DRAWKLINE(H,O,L,C);{写K线}
STICKLINE(MA1>=REF(MA1,1),H,L,0,0),COLOR0000FF;{均线上行,标记影线}
STICKLINE(MA1>=REF(MA1,1)AND(C>=O),O,C,3,1),COLOR0000FF;{均线上行,标记阳线}
STICKLINE(MA1>=REF(MA1,1)AND(C<=O),O,C,3,0),COLOR0000FF;{均线上行,标记阴线}
STICKLINE(MA1>=REF(MA1,1)ANDMA2<=REF(MA2,1)ANDCOUNT(MA1>=REF(MA1,1),20)>13,H,L,0,0),COLOR00FFFF;{做顶,标记影线}
STICKLINE(MA1>=REF(MA1,1)ANDMA2<=REF(MA2,1)ANDCOUNT(MA1>=REF(MA1,1),20)>13AND(C>=O),O,C,3,1),COLOR00FFFF;{做顶,标记阳线}
STICKLINE(MA1>=REF(MA1,1)ANDMA2<=REF(MA2,1)ANDCOUNT(MA1>=REF(MA1,1),20)>13AND(C<=O),O,C,3,0),COLOR00FFFF;{做顶,标记阴线}
STICKLINE(MA1<REF(MA1,1),H,L,0,0),COLOR00FF00;{均线下行,标记影线}
STICKLINE(MA1<REF(MA1,1)AND(C>=O),O,C,3,1),COLOR00FF00;{均线下行,标记阳线}
STICKLINE(MA1<REF(MA1,1)AND(C<=O),O,C,3,0),COLOR00FF00;{均线下行,标记阴线};
STICKLINE(MA1<=REF(MA1,1)ANDMA2>=REF(MA2,1)ANDCOUNT(MA1<=REF(MA1,1),30)>15,H,L,0,0),COLORFF00FF;{做底,标记影线}
STICKLINE(MA1<=REF(MA1,1)ANDMA2>=REF(MA2,1)ANDCOUNT(MA1<=REF(MA1,1),30)>15AND(C>=O),O,C,3,1),COLORFF00FF;{做底,标记阳线}
STICKLINE(MA1<=REF(MA1,1)ANDMA2>=REF(MA2,1)ANDCOUNT(MA1<=REF(MA1,1),30)>15AND(C<=O),O,C,3,0),COLORFF00FF;{做底,标记阴线};
每日公式解答:
股票公式编写要求:
开盘涨幅、换手率、量比都是5%的预警公式。
股票公式编写结果:
O/REF(C,1)>-1.05&&HSL>=5&&DYNAINFO(17)>=5;
评论(0)