拐点擒龙通达信公式 主图 源码附图有未来
{参数N:=3;}
A线:EMA(EMA(EMA(EMA(CLOSE,2),2),2),2),LINETHICK1,COLOR0000FF;
B线:EMA(REF(A线,1),2),LINETHICK1,COLOR00FFFF;
趋势:EMA(EMA(EMA(EMA(EMA(CLOSE,55),2),2),2),2),LINETHICK1,COLORFF00FF;
C2:=REF(C,1);
VAR1:=ZIG(3,10)<REF(ZIG(3,10),1) AND REF(ZIG(3,10),1)>REF(ZIG(3,10),2);{ZIG 有未来}
VAR2:=ZIG(3,10)>REF(ZIG(3,10),1) AND REF(ZIG(3,10),1)<REF(ZIG(3,10),2);
STICKLINE(VAR1,C,O,2,0),COLORYELLOW,LINETHICK1;{高位黄s}
STICKLINE(VAR1,C,O,2,0),COLORYELLOW,LINETHICK1;{高位黄s}
STICKLINE(VAR1,H,L,1,0),COLORYELLOW,LINETHICK1;{高位黄s}
STICKLINE(VAR2,C,O,2,0),COLORFF00FF,LINETHICK1;{底位红色}
STICKLINE(VAR2,C,O,2,0),COLORFF00FF,LINETHICK1;{底位红色}
STICKLINE(VAR2,H,L,1,0),COLORFF00FF,LINETHICK1;{底位红色};
AA:DRAWTEXT(CROSS(ZIG(3,8),REF(ZIG(3,8),1)),LOW*0.978,'★拐点底') ,LINETHICK2,COLORYELLOW;
DRAWTEXT(CROSS(REF(ZIG(3,10),1),ZIG(3,10)),HIGH*1.02,'波段顶 '),LINETHICK2,COLOR00FF00;
MA1:=MA(VAR1,3);
VAR3:=LLV(HIGH,240);
VAR4:=100*(CLOSE-VAR3)/VAR3;
VAR5:=(CLOSE-LLV(LOW,528))/(HHV(HIGH,528)-LLV(LOW,528))*100;
VAR6:=(CLOSE-LLV(CLOSE,530))/(HHV(CLOSE,530)-LLV(CLOSE,530))*100;
VAR7:=0;
VAR8:=SMA(MAX(CLOSE-REF(CLOSE,1),0),34,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),7,1)*100;
VAR9:=SMA(MAX(CLOSE-REF(CLOSE,1),0),13,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),13,1)*100;
VAR10:=IF(TROUGHBARS(3,16,1)=0 AND HIGH>LOW+0.04,4,0);
VAR11:=ZIG(3,6)>REF(ZIG(3,6),1) AND REF(ZIG(3,6),1)<=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)<=REF(ZIG(3,6),3);
VAR12:=ZIG(3,6)<REF(ZIG(3,6),1) AND REF(ZIG(3,6),1)>=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)>=REF(ZIG(3,6),3);
VAR13:=ZIG(3,22)>REF(ZIG(3,22),1) AND REF(ZIG(3,22),1)<=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)<=REF(ZIG(3,22),3);
VAR14:=ZIG(3,22)<REF(ZIG(3,22),1) AND REF(ZIG(3,22),1)>=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)>=REF(ZIG(3,22),3);
VAR15:=ZIG(3,51)>REF(ZIG(3,51),1) AND REF(ZIG(3,51),1)<=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)<=REF(ZIG(3,51),3);
VAR16:=ZIG(3,51)<REF(ZIG(3,51),1) AND REF(ZIG(3,51),1)>=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)>=REF(ZIG(3,51),3);
VAR17:=ZIG(3,72)>REF(ZIG(3,72),1) AND REF(ZIG(3,72),1)<=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)<=REF(ZIG(3,72),3);
VAR18:=ZIG(3,72)<REF(ZIG(3,72),1) AND REF(ZIG(3,72),1)>=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)>=REF(ZIG(3,72),3);
VAR19:=EMA(CLOSE,2)-EMA(CLOSE,150);
买1:=VAR10;
买2:=(VAR11+VAR13+VAR15+VAR17);
卖1:=(VAR12+VAR14+VAR16+VAR18);
DRAWICON((ZIG(3,5)>REF(ZIG(3,5),1)) AND (REF(ZIG(3,5),1)<=REF(ZIG(3,5),2)) AND (REF(ZIG(3,5),2)<=REF(ZIG(3,5),3)),LOW*0.98,1) ;
DRAWICON((ZIG(3,5)<REF(ZIG(3,5),1)) AND (REF(ZIG(3,5),1)>=REF(ZIG(3,5),2)) AND (REF(ZIG(3,5),2)>=REF(ZIG(3,5),3)),HIGH*1.01,2);
ZB:=EMA(EMA(VAR3,5),5)*3, ;
VARA:=IF(VAR9 AND CROSS(MA(CLOSE,3),MA(CLOSE,5)),20,0);
K:= 5 *2, , COLORFF00FF;
D:= 5 , , COLORWHITE;
J:=K*3-D*2, ,COLORYELLOW;
VARB:=BETWEEN(CLOSE,MA(CLOSE,3),MA(CLOSE,5)) AND J>10;
HS:=VOL/CAPITAL*100, , COLORGREEN;
VARE:=MA(100*(CLOSE-LLV(CLOSE,34))/(HHV(HIGH,34)-LLV(LOW,34)),5)-20;
VARF:=100-3*SMA((CLOSE-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1)+2*SMA(SMA((CLOSE-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1),15,1);
VAR1A:=IF(VARE>0,VARE,0);
VAR1B:=IF(VAR14>=200 AND VAR13>=150,15,IF(VAR14<=-200 AND VAR13<=-150,-15,VAR16))+60;
VAR1C:=VAR1A>48 AND VAR1B>60 AND VAR19<100;
STICKLINE((C-REF(C,1))/REF(C,1)>=0.0985,O,C,2,0),COLORYELLOW;
STICKLINE((C-REF(C,1))/REF(C,1)>=-0.0985 AND (C-REF(C,1))/REF(C,1)<0,O,C,2,0),COLORCYAN;
STICKLINE(C>REF(C,1) AND C<O ,O,C,2,0),COLORCYAN;
STICKLINE((C-REF(C,1))/REF(C,1)<=-0.0985,O,C,2,0),COLORBLUE;
未来函数检测结果如下:
该公式包含未来函数:ZIG
该公式包含未来函数:TROUGH
该公式包含未来函数:TROUGHBARS
该公式包含未来函数:CAPITAL
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
{参数N赋值:3
输出}
A线:收盘价的2日指数移动平均,2),2),2),LINETHICK1,COLOR0000FF
输出B线:E1日前的A线的2日简单移动平均,LINETHICK1,COLOR00FFFF
输出趋势:收盘价的55日指数移动平均,2),2),2),2),LINETHICK1,COLORFF00FF
C2赋值:1日前的C
VAR1赋值:ZIG(3,10)[REF(ZIG(3,10),2)]
{ZIG 有未来}
VAR2赋值:ZIG(3,10)>REF(ZIG(3,10),1) AND REF(ZIG(3,10),1)[当满足条件VAR1时,在C和O之间画柱状线]
当满足条件VAR1时,在C和O之间画柱状线
当满足条件VAR1时,在H和L之间画柱状线
当满足条件VAR2时,在C和O之间画柱状线
当满足条件VAR2时,在C和O之间画柱状线
当满足条件VAR2时,在H和L之间画柱状线
{底位红色}
输出AA:DRAWTEXT(CROSS(ZIG(3,8),REF(ZIG(3,8),1)),最低价*0.978,'★拐点底') ,LINETHICK2,画黄色
DRAWTEXT(CROSS(REF(ZIG(3,10),1),ZIG(3,10)),最高价*1.02,'波段顶 '),LINETHICK2,COLOR00FF00
MA1赋值:VAR1的3日简单移动平均
VAR3赋值:240日内最高价最低值
VAR4赋值:100*(收盘价-VAR3)/VAR3
VAR5赋值:(收盘价-528日内最低价最低值)/(528日内最高价最高值-528日内最低价最低值)*100
VAR6赋值:(收盘价-530日内收盘价最低值)/(530日内收盘价最高值-530日内收盘价最低值)*100
VAR7赋值:0
VAR8赋值:SMA(收盘价-1日前的收盘价和0较大值,34,1)/SMA(收盘价-1日前的收盘价的绝对值,7,1)*100
VAR9赋值:SMA(收盘价-1日前的收盘价和0较大值,13,1)/SMA(收盘价-1日前的收盘价的绝对值,13,1)*100
VAR10:=IF(TROUGHBARS(3,16,1)=0 AND 最高价>最低价+0.04,4,0)
VAR11:=ZIG(3,6)>REF(ZIG(3,6),1) AND REF(ZIG(3,6),1)<=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)<=REF(ZIG(3,6),3)
VAR12:=ZIG(3,6)[=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)>=REF(ZIG(3,6),3)]
VAR13:=ZIG(3,22)>REF(ZIG(3,22),1) AND REF(ZIG(3,22),1)<=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)<=REF(ZIG(3,22),3)
VAR14:=ZIG(3,22)[=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)>=REF(ZIG(3,22),3)]
VAR15:=ZIG(3,51)>REF(ZIG(3,51),1) AND REF(ZIG(3,51),1)<=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)<=REF(ZIG(3,51),3)
VAR16:=ZIG(3,51)[=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)>=REF(ZIG(3,51),3)]
VAR17:=ZIG(3,72)>REF(ZIG(3,72),1) AND REF(ZIG(3,72),1)<=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)<=REF(ZIG(3,72),3)
VAR18:=ZIG(3,72)[=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)>=REF(ZIG(3,72),3)]
VAR19:=收盘价的2日指数移动平均-收盘价的150日指数移动平均
买1赋值:VAR10
买2赋值:(VAR11+VAR13+VAR15+VAR17)
卖1赋值:(VAR12+VAR14+VAR16+VAR18)
DRAWICON((ZIG(3,5)>REF(ZIG(3,5),1)) AND (REF(ZIG(3,5),1)<=REF(ZIG(3,5),2)) AND (REF(ZIG(3,5),2)<=REF(ZIG(3,5),3)),最低价*0.98,1)
DRAWICON((ZIG(3,5)[=REF(ZIG(3,5),2)) AND (REF(ZIG(3,5),2)>=REF(ZIG(3,5),3)),最高价*1.01,2)]
ZB赋值:VAR3的5日指数移动平均,5)*3,
VARA赋值:IF(VAR9 AND CROSS(收盘价的3日简单移动平均,收盘价的5日简单移动平均),20,0)
K赋值: 5 *2, , COLORFF00FF
D赋值: 5 , , 画白色
J赋值:K*3-D*2, ,画黄色
VARB赋值:BETWEEN(收盘价,收盘价的3日简单移动平均,收盘价的5日简单移动平均) AND J>10
HS赋值:成交量/当前流通股本*100, , 画绿色
VARE赋值:MA(100*(收盘价-34日内收盘价最低值)/(34日内最高价最高值-34日内最低价最低值),5)-20
VARF赋值:100-3*SMA((收盘价-75日内最低价最低值)/(75日内最高价最高值-75日内最低价最低值)*100,20,1)+2*SMA(SMA((收盘价-75日内最低价最低值)/(75日内最高价最高值-75日内最低价最低值)*100,20,1),15,1)
如果VARE>0返回VARE否则返回0
VAR1B:=IF(VAR14>=200 AND VAR13>=150,15,IF(VAR14<=-200 AND VAR13<=-150,-15,VAR16))+60
VAR1C:=VAR1A>48 AND VAR1B>60 AND VAR19<100
STICKLINE((C-1日前的C)/1日前的C>=0.0985,O,C,2,0),画黄色
STICKLINE((C-1日前的C)/1日前的C>=-0.0985 AND (C-1日前的C)/1日前的C<0,O,C,2,0),画青色
STICKLINE(C>1日前的C AND C
STICKLINE((C-1日前的C)/1日前的C<=-0.0985,O,C,2,0), 画蓝色