相关简介:通达信两阳夹一阴(多方炮)选股指标公式源码分享
通达信指标公式源码概况:
指标类别:通达信指标公式
授权方式:免费版
指标评级:★★★★★
指标分类:策略
画线方法:副图
那什么是多方炮形态呢?
所谓多方炮的技术形态就是两阳夹一阴,由三根k线组成,而且两阳实体较长,阴线实体较小,形成一种两阳包含阴线之势,出现了多方炮形态之后,那么接下来一般情况下都会有一波不错的上涨行情。
多方炮常见图形:两红夹一黑,两红,指的是两根红色的阳线,一黑,指的是一根阴线。两红夹一黑,指的是两根阳线中间夹着一根阴线。两红夹一黑三根K线的中轴几乎在同一水平位置,中间的阴线实体较短,两边的阳线实体较长,少数情况下,三根K线的实体大小相当。但无论如何,被夹在中间的阴线实体长度不能大于两边阳线的实体长度。夹在中间的K线也可以是小十字星或T字线。
指标使用技术要点:
1、个股或指数必须是出现在一轮明显的下跌之后,股价有一个低位止跌横盘的过程。
2、出现第一根阳线时,必须是伴随较大交易量的,而且其收盘价格要突破中期均线(如20日线或30日线),或者创下近期的新高;
3、第二天出现的跳空高开阴线,其成交量和前一天阳线成交量相比,必须是出现萎缩的;
4、第三天阳线收盘价最好高于第一天收盘价,其成交量也要比第一天更大,但是又不可以是巨量。
多方炮最佳买点:可在第3根阳线即将吞没第2根阴线时就可介入,或在多方炮形成后的次日盘中放量上攻时买入。
两阳夹一阴,第二根阴线必须缩量,第三根阳线的收盘价高于第一天的收盘价,成交量也较第二天阴线放大1.5倍以上。
通达信指标公式源码:
A1:=REF(CLOSE,2)>REF(OPEN,2)ANDREF(CLOSE,1)<REF(OPEN,1)ANDCLOSE>OPEN;{三日均线描述}
A2:=REF(C,2)/REF(O,2)>1.03;{前天的涨幅大于3%}
A3:=REF(H,1)/REF(L,1)>1.03;{昨振幅大于3%}
A4:=C/REF(C,1)>1.03;{今天涨幅大于3%}
A5:=REF(C,1)/REF(C,2)<1.01ANDREF(O,1)/REF(C,2)<1.01;{昨天阴线开盘及收盘价均在前日收盘价1.01以内}
A6:=REF(C,1)>REF(O,2);{昨天阴线收盘要大于前日开盘价}
A7:=C>REF(O,1);{今日收盘价大于昨日的开盘价}
A8:A1ANDA2ANDA3ANDA4ANDA5ANDA6ANDA7;
B1:=ma(C,1);
B2:=SMA(SMA(SMA(B1,2,1),2,1),2,1);
SMA2:=MA(B2,3);
停损下限:IF(LLV(MA(B2,8),3)<B2,LLV(MA(B2,8),3),B2);
IF(B2>SMA2,B2,DRAWNULL),COLORRED,LINETHICK4;
IF(B2<SMA2,B2,DRAWNULL),COLORGREEN,LINETHICK4;
SNAKEA:HHV(MA(B2,1),13),COLORYELLOW;
VAR1A:=(2*CLOSE+HIGH+LOW)/4;
VAR2A:=MA(VAR1A,7);
VAR3A:=VAR2A-MA(VAR1A,7/2)<0;
VAR4A:=VAR2A-MA(VAR1A,7/2)>0;
VAR5A:=BArslAst(VAR3A);
VAR6A:=0-BARSLAST(VAR4A);
VAR7A:=IF(VAR3A<=0,VAR5A,VAR6A);
STICKLINE(SNAKEA>B2ANDB2>SMA2,SNAKEA,B2,0,0),COLORBLUE;
STICKLINE(SNAKEA>SMA2ANDB2<SMA2,SNAKEA,SMA2,0,0),COLORBLUE;
VAR11A:=(CLOSE*2+HIGH+LOW)/4;
VAR21A:=EMA(VAR11A,13)-EMA(VAR11A,34);
VAR31A:=EMA(VAR21A,5);
{STICKLINE((C>=O),OPEN,LOW,0,0),COLOR0726CA;
STICKLINE((C>=O),CLOSE,HIGH,0,0),COLOR0726CA;
STICKLINE((C<O),CLOSE,LOW,0,0),COLORDE9100;
STICKLINE((C<O),OPEN,HIGH,0,0),COLORDE9100;
STICKLINE((C<O),CLOSE,OPEN,2.5,0),COLORFFCC00;
STICKLINE((C<O),CLOSE,OPEN,1.5,0),COLORFFFF00;
STICKLINE((C>O),CLOSE,OPEN,2,0),COLOR0754E9;
STICKLINE((C>O),CLOSE,OPEN,1.5,0),COLOR076EF3;
STICKLINE((C>O),CLOSE,OPEN,1,0),COLOR077BF3;}
VAR2:=((CLOSE>REF(CLOSE,1))AND(CLOSE>REF(CLOSE,2)));
VAR3:=((REF(VAR2,1)AND(CLOSE<=REF(CLOSE,1)))AND(CLOSE>=REF(CLOSE,2)));
VAR4:=((REF(VAR3,1)AND(CLOSE>=REF(CLOSE,1)))AND(CLOSE<=REF(CLOSE,2)));
VAR5:=((REF(VAR4,1)AND(CLOSE<=REF(CLOSE,1)))AND(CLOSE>=REF(CLOSE,2)));
VAR6:=((REF(VAR5,1)AND(CLOSE>=REF(CLOSE,1)))AND(CLOSE<=REF(CLOSE,2)));
VAR7:=((REF(VAR6,1)AND(CLOSE<=REF(CLOSE,1)))AND(CLOSE>=REF(CLOSE,2)));
VAR8:=((REF(VAR7,1)AND(CLOSE>=REF(CLOSE,1)))AND(CLOSE<=REF(CLOSE,2)));
VAR9:=((REF(VAR8,1)AND(CLOSE<=REF(CLOSE,1)))AND(CLOSE>=REF(CLOSE,2)));
VARA:=((REF(VAR9,1)AND(CLOSE>=REF(CLOSE,1)))AND(CLOSE<=REF(CLOSE,2)));
VARB:=((REF(VARA,1)AND(CLOSE<=REF(CLOSE,1)))AND(CLOSE>=REF(CLOSE,2)));
VARC:=((REF(VARB,1)AND(CLOSE>=REF(CLOSE,1)))AND(CLOSE<=REF(CLOSE,2)));
VARD:=((REF(VARC,1)AND(CLOSE<=REF(CLOSE,1)))AND(CLOSE>=REF(CLOSE,2)));
VARE:=((CLOSE<REF(CLOSE,1))AND(CLOSE<REF(CLOSE,2)));
VARF:=((REF(VARE,1)AND(CLOSE>=REF(CLOSE,1)))AND(CLOSE<=REF(CLOSE,2)));
VAR10:=((REF(VARF,1)AND(CLOSE<=REF(CLOSE,1)))AND(CLOSE>=REF(CLOSE,2)));
VAR11:=((REF(VAR10,1)AND(CLOSE>=REF(CLOSE,1)))AND(CLOSE<=REF(CLOSE,2)));
VAR12:=((REF(VAR11,1)AND(CLOSE<=REF(CLOSE,1)))AND(CLOSE>=REF(CLOSE,2)));
VAR13:=((REF(VAR12,1)AND(CLOSE>=REF(CLOSE,1)))AND(CLOSE<=REF(CLOSE,2)));
VAR14:=((REF(VAR13,1)AND(CLOSE<=REF(CLOSE,1)))AND(CLOSE>=REF(CLOSE,2)));
VAR15:=((REF(VAR14,1)AND(CLOSE>=REF(CLOSE,1)))AND(CLOSE<=REF(CLOSE,2)));
VAR16:=((REF(VAR15,1)AND(CLOSE<=REF(CLOSE,1)))AND(CLOSE>=REF(CLOSE,2)));
VAR17:=((REF(VAR16,1)AND(CLOSE>=REF(CLOSE,1)))AND(CLOSE<=REF(CLOSE,2)));
VAR18:=((REF(VAR17,1)AND(CLOSE<=REF(CLOSE,1)))AND(CLOSE>=REF(CLOSE,2)));
VAR19:=((REF(VAR18,1)AND(CLOSE>=REF(CLOSE,1)))AND(CLOSE<=REF(CLOSE,2)));
VAR1B:=(REF((((((((((((VAREORVARF)ORVAR10)ORVAR11)ORVAR12)ORVAR13)ORVAR14)ORVAR15)ORVAR16)ORVAR17)ORVAR18)ORVAR19),1)ANDVAR2);
{STICKLINE(VAR1B,O,O+(C-O)/3,3,0),COLOR10D0FF;}
STICKLINE(VAR1B,O,O+(C-O)/3,2,0),COLOR10FFFF;
STICKLINE(VAR1B,O,O+(C-O)/3,1,0),COLOR00FFFF;
AA:=(REF((((((((((((VAR2ORVAR3)ORVAR4)ORVAR5)ORVAR6)ORVAR7)ORVAR8)ORVAR9)ORVARA)ORVARB)ORVARC)ORVARD),1)ANDVARE);
{STICKLINE(AA,O,O+(C-O)/3,3,0),COLOR00DD00;}
STICKLINE(AA,O,O+(C-O)/3,2,0),COLOR00EE00;
STICKLINE(AA,O,O+(C-O)/3,1,0),COLOR00FF00;
A13:=EMA(CLOSE,55);
A14:=MA(CLOSE,75);
A15:=EMA(A14,3);
A16:=EMA(A15,3);
A17:=(HIGH+LOW)/5;
A18:=(MA(A17,4))-(MA(A17,34));
A19:=crOSS(A18,0);
A20:=CROSS(0,A18);
A21:=BARSLAST(A19);
A22:=BARSLAST(A20);
A23:=REF(A19,1);
A24:=REF(A20,1);
A25:=BARSLAST(A23);
A26:=BARSLAST(A24);
A27:=IF((A25A27))AND(A21=(REF(A27,1)))AND(CLOSE(REF(BARSLAST(A30),1)));
DRAWTEXT(A32,SMA2*0.99,’←═≒∝’),COLORYELLOW;
ac:=AMOUNT/(vol);
YY:=MA(AC,13);
LLL:=(C-YY)/YY*100;
MIDC:=MA(CLOSE,22);
UPPERC:=MIDC+2*STD(C,22);
LOWERC:=MIDC-2*STD(C,22);
BBA:=(C-LOWERC)/(UPPERC-LOWERC);
BBC:=FORCAST(BBA,3);
LIFENGcyc:=(REF(LLL,1)<-15ANDREF(BBA,1)<0ANDLLL>REF(LLL,1));
{//STICKLINE(LIFENGCYC,BBC,0.5,6,0);}
{/bbd:(UPPER+LOWER)/2*(C-UPPER);}
STICKLINE(LIFENGCYC>0,C,O,2,0),COLOR10ABFF;
{STICKLINE(LIFENGCYC>0,C,O,1.5,0),COLOR10D0FF;
STICKLINE(LIFENGCYC>0,C,O,1,0),COLOR10FFFF;}
DRAWTEXT(LIFENGCYC>0,LOW*0.99,’☆’),COLORDD00DD;
TJ:=DYNAINFO(4)>0
ANDHHV(HIGH,10)/LLV(LOW,10)<1.25
ANDREF(CLOSE,1)<(LLV(LOW,15)+(HHV(HIGH,15)-LLV(LOW,15))*0.85)
ANDCLOSE>OPEN
ANDCLOSE>=HHV(HIGH,10);
STICKLINE(C/REF(C,1)>=1.096ANDH=C,O,C,1,0),COLORYELLOW;
放量突破:TJ,NODRAW,COLORRED;
DRAWTEXT(TJ,L-0.3,’放量突破’),COLORRED;
W1:=C=HHV(C,20);
W2:=BARSLAST(W1);
W3:=IF(W2>0,REF(C,W2),REF(C,W2));
W4:=CROSS(C,REF(W3,1));
回调突破:=W4ANDCOUNT(W4,5)=1;
DRAWTEXT(回调突破>0,MA(L,3),’*回调突破’),COLORYELLOW;
敢死队操作线:MA(C,24),LINETHICK2,COLORLIMAGENTA;
{
选股公式:
W1:=C=HHV(C,20);
W2:=BARSLAST(W1);
W3:=IF(W2>0,REF(C,W2),REF(C,W2));
W4:=CROSS(C,REF(W3,1));
回调突破:W4ANDCOUNT(W4,5)=1;
}
CC:=REF((C-O)/2+O,1);
A:=C<O;
A1:=C>OANDC>REF(O,1)ANDO>REF(C,1);
A2:=C<OANDO<=REF(C,1)ANDVOL>REF(VOL,1)ANDC+0.02>=CC;
XG:=REF(A,2)ANDREF(A1,1)ANDA2;
STICKLINE(XG,C,O,1.8,0),COLORBROWN;
STICKLINE(XG,H,L,0,0),COLORBROWN;
DRAWICON(XG,H*1.04,23);
[源码注释]通达信公式动态翻译结果
ZT赋值:如果模糊匹配品种名称ORNAMELIKE(‘*ST’),返回收盘价=计算涨停价,否则返回如果模糊匹配品种代码OR(模糊匹配品种代码ANDDATE>=1200824),返回收盘价=计算涨停价,否则返回收盘价=计算涨停价
AA赋值:首次ZT距今天数
AA日前的收盘价上穿收盘价的120日简单移动平均 AND 统计AA日中满足ZT的天数<=2 AND 统计AA日中满足ZT的天数>0
评论(0)