通达信VCP形态选股公式 源码附图
SL:=EMA(EMA(SLOPE(C,10)*5+C,10),2);
DI:=REF(SL,1)<REF(SL,2) AND REF(SL,1)<SL;
DING:=REF(SL,1)>REF(SL,2) AND REF(SL,1)>SL;
TDI1:=BARSLAST(DI)+1;
TDI2:=SUMBARS(DI,2);
TDI3:=SUMBARS(DI,3);
TDI4:=SUMBARS(DI,4);
DINGH1:=FINDHIGH(H,TDI1,TDI2-TDI1,1);
DINGH2:=FINDHIGH(H,TDI2,TDI3-TDI2,1);
DINGH3:=FINDHIGH(H,TDI3,TDI4-TDI3,1);
TDING1:=BARSLAST(DING)+1;
TDING2:=SUMBARS(DING,2);
TDING3:=SUMBARS(DING,3);
DIL1:=FINDLOW(L,TDING1,TDING2-TDING1,1);
DIL2:=FINDLOW(L,TDING2,TDING3-TDING2,1);
DL:=FINDLOW(L,1,TDING1,1);
MAXH:=MAX(DINGH1,MAX(DINGH2,DINGH3));
MINH:=MIN(DINGH1,MIN(DINGH2,DINGH3));
A1:=(MAXH-MINH)/MINH*100<5;
A2:=(DIL1-DIL2)/DIL2*100>-2 AND DL>DIL1;
A3:=H=HHV(H,20) AND C>O;
AA:=A1 AND A2 AND A3;
XG:=FILTER(AA,20);
DRAWICON(XG,L,1);
STICKLINE(XG,H,L,0,0),COLORYELLOW;
STICKLINE(XG,O,C,3,0),COLORYELLOW;
未来函数检测结果如下:
该公式包含未来函数:DHIGH
该公式包含未来函数:DLOW
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
SL赋值:EMA(EMA(SLOPE(C,10)*5+C,10),2)
DI赋值:1日前的SL<2日前的SL AND 1日前的SLDING:=1日前的SL>2日前的SL AND 1日前的SL>SL
TDI1:=上次DI距今天数+1
TDI2:=DI累加至2的天数
TDI3:=DI累加至3的天数
TDI4:=DI累加至4的天数
DINGH1:=FIND最高价(H,TDI1,TDI2-TDI1,1)
DINGH2:=FIND最高价(H,TDI2,TDI3-TDI2,1)
DINGH3:=FIND最高价(H,TDI3,TDI4-TDI3,1)
TDING1:=上次DING距今天数+1
TDING2:=DING累加至2的天数
TDING3:=DING累加至3的天数
DIL1:=FINDLOW(L,TDING1,TDING2-TDING1,1)
DIL2:=FINDLOW(L,TDING2,TDING3-TDING2,1)
DL赋值:FINDLOW(L,1,TDING1,1)
MAXH赋值:MAX(DINGH1,MAX(DINGH2,DINGH3))
MINH赋值:MIN(DINGH1,MIN(DINGH2,DINGH3))
A1赋值:(MAXH-MINH)/MINH*100<5
A2赋值:(DIL1-DIL2)/DIL2*100>-2 AND DL>DIL1
A3赋值:H=20日内H最高值 AND C>O
AA赋值:A1 AND A2 AND A3
XG赋值:AA的20过滤
当满足条件XG时,在L和1之间画图标
当满足条件XG时,在H和L之间画柱状线
当满足条件XG时,在O和C之间画柱状线