通达信公式源码概况:
指标类别:通达信公式
授权方式: 免费版
指标评级: ★★★★★
指标分类: 策略
画线方法: 副图
一、通达信抓涨停副图指标公式
N1:=7;N2:=14;N3:=21;
界:=38,COLORFF3311;
STICKLINE(C>0,38,38,1,1),COLORFF9911;
加仓线:=51,COLORFF1155;
STICKLINE(C>0,51,51,1,1),COLORFF1199;
LC:=REF(CLOSE,1);
RSI1:SMA(MAX(CLOSE-LC,0),N1,1)/SMA(ABS(CLOSE-LC),N1,1)*100,COLORFFFFFF;
RSI2:SMA(MAX(CLOSE-LC,0),N1,1)/SMA(ABS(CLOSE-LC),N1,1)*100,COLORFFFFFF;
RSI3:SMA(MAX(CLOSE-LC,0),N1,1)/SMA(ABS(CLOSE-LC),N1,1)*100,COLORFFFFFF;
RSI4:SMA(RSI3,7,1),LINETHICK2,COLOR00CD00;
趋势F:=XMA(((CLOSE-LLV(LOW,48))/(HHV(HIGH,48)-LLV(LOW,48))*50),17)+9,COLORFFFFFF;
趋势8:=XMA(((CLOSE-LLV(LOW,53))/(HHV(HIGH,53)-LLV(LOW,53))*50),17)+9,COLOR3377DD;
趋势:EMA(((CLOSE-LLV(LOW,38))/(HHV(HIGH,38)-LLV(LOW,38))*50),17)+18,COLORYELLOW,LINETHICK2;
WR1:XMA(趋势F,7)*1.372,COLORRED,LINETHICK2;
WR2:=WR1*1.0887;
WRF:(1.5*(趋势8+RSI4)-(WR2+WR1))+12,COLOR3377FF,COLORRED,LINETHICK2,COLORFF0000;
BUY:IF((CROSS(WR1,趋势)ORCROSS(WR1,WRF)ANDWRF<界ANDRSI2<加仓线),48,38),COLORFFFFFF;
XG:IF((CROSS(RSI2,RSI4)ORCROSS(RSI2,WRF)ANDWRF<界ANDRSI1<加仓线),48,38),COLORFF6655;
DIF:(EMA(CLOSE,12)-EMA(CLOSE,26)),COLORRED,NODRAW;
DEA:EMA(DIF,9),COLOR00FFFF,NODRAW;
MACD:2*(DIF-DEA),NODRAW;
DIFK:=EMA(DIF,3);
DIFD:=EMA(DIFK,3);
DKK:4*DIF-3*DEA,COLORFF00FF,NODRAW;
DDD:EMA(DKK,5),COLOR2588FF,NODRAW;
TRLSX1:=MAX(MAX((HHV(DIF,13)-LLV(DIF,13)),ABS(REF(DIF,1)-HHV(DIF,13))),ABS(REF(DIF,1)-LLV(DIF,13)));
TRLSX2:=EMA(TRLSX1,13);
TRLSX3:=REF(DIF,1)-REF(TRLSX2,1);
支撑:HHV(TRLSX3,13),COLORFFFFFF,NODRAW;
RSV14:=(CLOSE-LLV(LOW,14))/(HHV(HIGH,14)-LLV(LOW,14))-0.5;
K14:=EMA(RSV14,3),COLORFF00FF,NODRAW;
D14:=EMA(K14,3),COLORGREEN,NODRAW;
J14:=3*K14-2*D14;
DRAWBAND(DIF,RGB(200,50,55),DEA,RGB(50,100,10));
MACDXG2:=REF(COUNT(DIF>0ANDMACD<0ANDMACD<REF(MACD,1),4)=4,1)ANDMACD>REF(MACD,1);
STICKLINE(MACDXG2,MACD*1.2,0,2.8,0),COLORRED;
STICKLINE(MACD>REF(MACD,1)ANDMACD>0,0,MACD,1.8,0),COLOR000055;
STICKLINE(MACD>REF(MACD,1)ANDMACD>0,0,MACD,1.1,0),COLOR000099;
STICKLINE(MACD>REF(MACD,1)ANDMACD>0,0,MACD,0.6,0),COLOR0000BB;
{BBD动能操盘}
AL:=(C+L+H)/3;
AO:=SMA(AL,5,1)-SMA(AL,13,1);
BBD:(AO-SMA(AO,3,1))*100,COLORFFCCFF,NODRAW;
{动能线定义}
动能线:AO*10,COLORRED;
动能辅线:EMA(AO,5)*10,COLOR00FF00;
DRAWBAND(动能辅线,RGB(115,95,95),0,RGB(95,95,115));
{动能彩带}
DRAWBAND(动能线,RGB(175,0,55),动能辅线,RGB(55,175,0));
BBD支撑线:SMA(BBD,5,2),COLOR0033FF,LINETHICK2;
RSV1:=BBD;
RSV2:=BBD支撑线;
弱:IF(BACKSET(RSV2<REF(RSV2,1),1),RSV2,DRAWNULL),LINETHICK2,COLORFF3300;
{BBD彩色柱体}
BBD1:=IF(BBD>=REF(BBD,1),BBD,DRAWNULL);
BBD2:=IF(BBD<REF(BBD,1),BBD,DRAWNULL);
STICKLINE(BBD1,0,BBD,1.5,0),COLOR885588;
STICKLINE(BBD1,0,BBD,1,0),COLORAA77AA;
STICKLINE(BBD1,0,BBD,0.5,0),COLORBB99BB;
STICKLINE(BBD1,0,BBD,0.1,0),COLORDDAADD;
STICKLINE(BBD2,0,BBD,1.5,0),COLOR757500;
STICKLINE(BBD2,0,BBD,1,0),COLORAAAA00;
STICKLINE(BBD2,0,BBD,0.5,0),COLORBBBB00;
STICKLINE(BBD2,0,BBD,0.1,0),COLORDDDD00;
{BBD支撑线金叉死叉顶底背离}
BBD金叉:IF(CROSS(RSV1,RSV2),RSV2,DRAWNULL),CIRCLEDOT,COLORFF33FF;
BBD死叉:IF(CROSS(RSV2,RSV1),RSV2,DRAWNULL),CIRCLEDOT,COLORFFFF00;
SV1:=BARSLAST(REF(CROSS(RSV1,RSV2),1));
SV1A:=REF(CLOSE,SV1+1)>CLOSEANDRSV1>REF(RSV1,SV1+1)AND
B底背:IF(SV1A,RSV2,DRAWNULL),COLOR3366FF;
DRAWTEXT(SV1A,RSV2,'—B底背'),COLOR0033FF;
SV2:=BARSLAST(REF(CROSS(RSV2,RSV1),1));
SV2A:=REF(CLOSE,SV2+1)<CLOSEANDREF(RSV1,SV2+1)>RSV1ANDCROSS(RSV2,RSV1);
B顶背:IF(SV2A,RSV2,DRAWNULL),COLORFFFF00;
DRAWTEXT(SV2A,RSV2,'—B顶背'),COLORFFFF00;
{动能线金叉死叉顶底背离}
RSV3:=动能线;
RSV4:=动能辅线;
动能金叉:IF(CROSS(RSV3,RSV4),RSV3,DRAWNULL),CIRCLEDOT,COLOR0000FF;
动能死叉:IF(CROSS(RSV4,RSV3),RSV3,DRAWNULL),CIRCLEDOT,COLOR00FF00;
SV3:=BARSLAST(REF(CROSS(RSV3,RSV4),1));
SV3A:=REF(CLOSE,SV3+1)>CLOSEANDRSV3>REF(RSV3,SV3+1)AND
CROSS(RSV3,RSV4);
动底背:IF(SV3A,RSV3,DRAWNULL),COLOR0000FF;
DRAWTEXT(SV3A,RSV3,'—动底背'),COLOR0000FF;
SV4:=BARSLAST(REF(CROSS(RSV4,RSV3),1));
SV4A:=REF(CLOSE,SV4+1)<CLOSEANDREF(RSV3,SV4+1)>RSV3ANDCROSS(RSV4,RSV3);
动顶背:IF(SV4A,RSV3,DRAWNULL),COLOR00FF00;
DRAWTEXT(SV4A,RSV3,'—动顶背'),COLOR00FF00;
MA1:MA(CLOSE,5);
MA2:MA(CLOSE,10);
MA3:MA(CLOSE,25);
MA4:MA(CLOSE,60);
MA5:MA(CLOSE,610);
DRAWTEXT_FIX(1,0.00,0,0,HYBLOCK)COLOR0080FF;
DRAWTEXT_FIX(1,0.14,0,0,DYBLOCK)COLOR00FFFF;
DRAWTEXT_FIX(1,0.00,0.06,0,EXTERNSTR(0,1))COLOR0000FF;
DRAWTEXT_FIX(1,0.00,0.12,0,EXTERNSTR(0,2))COLORFF00FF;
DRAWTEXT_FIX(1,0.00,0.18,0,EXTERNSTR(0,3))COLORFF88FF;
DRAWTEXT_FIX(1,0.00,0.24,0,EXTERNSTR(0,5)),COLORLICYAN;
箱底:=TROUGH(CLOSE,10,1)*1.02,COLOR008888,LINETHICK2;
价低箱底:=COUNT(L<箱底,3);
底箱:=TROUGH(CLOSE,10,1)*1.05,COLOR008888,LINETHICK1;
DRAWTEXT(价低箱底>=1AND箱底<MA3ANDCROSS(C,底箱),L*0.9999,'杀入'),COLOR00CCCC;
DRAWTEXT(MA3>MA4AND价低箱底>=1AND箱底<MA3ANDCROSS(C,底箱),L*0.9999,'杀入加强'),COLOR00CCCC;
金手指:价低箱底>=1AND箱底<MA3ANDCROSS(C,底箱),COLOR00AAAA,NODRAW;
STICKLINE(金手指,OPEN,CLOSE,2.0,0),COLOR008888;
STICKLINE(金手指,OPEN,CLOSE,1.6,0),COLOR00AAAA;
STICKLINE(金手指,OPEN,CLOSE,0.8,0),COLOR00CCCC;
STICKLINE(金手指,OPEN,CLOSE,0.2,0),COLOR00FFFF;
止跌:=(REF(EVERY(C<O,2),1)ANDC>O);
VAR1N:=MA(CLOSE,5),;
VAR2N:=MA(CLOSE,10);
VAR3N:=(VAR1N-CLOSE)/CLOSE>3/100;
VAR4N:=(VAR2N-VAR1N)/VAR1N>0.03;
VAR5N:=LLV(CLOSE,30)=LLV(CLOSE,120);
底部:=VAR3NANDVAR4NANDVAR5N;
STICKLINE(BARSLAST(底部)<=2AND止跌,OPEN,CLOSE,2.0,0),COLORFF0066;
短趋势线:=MA(CLOSE,13),COLORRED,LINETHICK3;
中线:=MA(CLOSE,33),LINETHICK1;
中趋势线:=MA(CLOSE,55),LINETHICK1,COLORGRAY;
上极限:=((C-REF(MA(CLOSE,20),1))/20+短趋势线)*1.20;
DRAWTEXT(CROSS(短趋势线,C)ANDINDEXC>MA(INDEXC,13)AND短趋势线>REF(短趋势线,1)ANDV<REF(V,1)AND短趋势线>中趋势线,L*0.985,'买入'),COLORRED;
箱顶:=PEAK(CLOSE,10,1)*1.001,COLORFF4400;
RESV:=(CLOSE-LLV(LOW,13))/(HHV(HIGH,13)-LLV(LOW,13))*100;
KEE:=SMA(RESV,3,1);
DEE:=SMA(KEE,3,1);
JEE:=3*KEE-2*DEE;
RSV24:=(CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55))*100;
K24:=SMA(RSV24,3,1);
D24:=SMA(K24,3,1);
J24:=3*K24-2*D24;
压力位:=IF(CROSS(J24,JEE),H,REF(H,BARSLAST(CROSS(J24,JEE)))),COLOR669900,LINETHICK1;
支撑位:=IF(CROSS(JEE,J24),L,REF(L,BARSLAST(CROSS(JEE,J24)))),COLORCE6700,LINETHICK2;
追涨:=压力位<箱顶ANDCROSS(C,箱顶);
DRAWTEXT(压力位<箱顶ANDCROSS(C,箱顶),L,'追涨'),COLORCC8868;
A1:=REF(V,1);A2:=DVOL;A3:=A2/A1;
LNX:=A3-REF(A3,1),COLOR00CCCC,LINETHICK1;
E1:=REF(C,1);E2:=DCLOSE;E3:=(E2-E1)/E1*100;
QMX:=E3-REF(E3,1),COLOR00CCCC,LINETHICK2;
XG:=CROSS(LNX,500)ANDCROSS(QMX,10);
DRAWTEXT(XG=1,L*0.985,'金手指'),COLORCC8868;
DRAWICON(XG=1,L*0.99,11);
[源码注释]通达信公式动态翻译结果
ZT赋值:如果模糊匹配品种名称ORNAMELIKE('*ST'),返回收盘价/1日前的收盘价>0.495,否则返回如果模糊匹配品种代码OR(模糊匹配品种代码ANDDATE>=1200925),返回收盘价>1日前的收盘价>1.195,否则返回收盘价/1日前的收盘价>1.095
最近50日存在ZTANDREF(ZT,1)
每日通达信公式解答:
编写条件:
5日前涨幅大于8%的选股公式。
编写方法:
AA:=(C/REF(C,1)-1)*100;
XG:REF(AA,4)>8;
评论(0)