通达信压力支撑主图
HIGHN:=10;LOWN:=10;HIGHDISPLAY:=0;LOWDISPLAY:=0;ZGDISPLAY:=0;MADISPLAY:=0;
AA:=REF(H,HIGHN)=HHV(H,2*HIGHN+1);
QY:=BACKSET(AA,HIGHN+1);
CC:=FILTER(QY,HIGHN) AND H=HHV(H,HIGHN+1);
DDD:=BARSLAST(CC);
GDTS:=IF(CC,CURRBARSCOUNT,0);
DINGBU:=IF(DDD,REF(H,DDD),H);{顶部}
DINGBUTS:=IF(DDD,REF(GDTS,DDD),GDTS);
DINGBU1:=REF(DINGBU,DDD+1);
GDCS1:=CONST(DINGBUTS);
DINGBUTS1:=REF(DINGBUTS,DDD+1);
GDCS2:=CONST(DINGBUTS1);
DINGBU2:=REF(DINGBU1,DDD+1);
MM:=IF(CURRBARSCOUNT>GDCS2,0,1);
高点压力:DRAWLINE(CURRBARSCOUNT=GDCS2,H,CURRBARSCOUNT=GDCS1,H,1) COLORGREEN,LINETHICK2;
DRAWLINE(CURRBARSCOUNT=GDCS2,H,ISLASTBAR,REF(H,GDCS2-1),1),COLOR0055FF,POINTDOT;
DRAWLINE(CURRBARSCOUNT=GDCS1,H,ISLASTBAR,REF(H,GDCS1-1),1),COLORYELLOW,POINTDOT;
AA1:=REF(L,LOWN)=LLV(L,2*LOWN+1);
QY1:=BACKSET(AA1,LOWN+1);
CC1:=FILTER(QY1,LOWN) AND L=LLV(L,LOWN+1);
DD1:=BARSLAST(CC1);
DDTS:=IF(CC1,CURRBARSCOUNT,0);
YDB:=IF(DD1,REF(L,DD1),L);
DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS);
DDCS1:=CONST(DDTS1);
ZDB:=REF(YDB,DD1+1);
DDTS2:=REF(DDTS1,DD1+1);
DDCS2:=CONST(DDTS2);
低点支撑:DRAWLINE(CURRBARSCOUNT=DDCS2,L,CURRBARSCOUNT=DDCS1,L,1) COLORRED,LINETHICK2;
ZGSTAR:=(高点压力+低点支撑)/2;
ZGEND:=CONST((高点压力+低点支撑)/2);
STARDAY:=IF(DDCS2<GDCS2,DDCS2,GDCS2);
中轨:DRAWLINE(CURRBARSCOUNT=STARDAY,ZGSTAR,ISLASTBAR,ZGEND,1),COLORFF55BB,LINETHICK2;
DRAWLINE(CURRBARSCOUNT=DDCS1,L,ISLASTBAR,REF(L,DDCS1-1),1),COLORMAGENTA,POINTDOT,;
DRAWLINE(CURRBARSCOUNT=DDCS2,L,ISLASTBAR,REF(L,DDCS2-1),1),COLORCYAN,POINTDOT;
DRAWTEXT_FIX(1,0,0,0,'【所属板块】'),COLORWHITE;
Z1:=STRCAT(HYBLOCK,' ');
Z2:=STRCAT(Z1,DYBLOCK);
Z3:=STRCAT(Z2,' ');
DRAWTEXT_FIX(1,0.1,0,0,STRCAT(Z3,GNBLOCK)),COLOR0000FF;
未来函数检测结果如下:
该公式包含未来函数:BACKSET
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
HIGHN赋值:10
LOWN赋值:10
HIGHDISPLAY赋值:0
LOWDISPLAY赋值:0
ZGDISPLAY赋值:0
MADISPLAY赋值:0
AA赋值:HIGHN日前的H=2*HIGHN+1日内H最高值
QY赋值:BACKSET(AA,HIGHN+1)
CC赋值:QY的HIGHN过滤 AND H=HIGHN+1日内H最高值
DDD赋值:上次CC距今天数
如果CC返回 到最后交易的周期否则返回0
DINGBU赋值:IF(DDD,DDD日前的H,H)
{顶部}
DINGBUTS:=IF(DDD,DDD日前的GDTS,GDTS)
DINGBU1:=DDD+1日前的DINGBU
GDCS1赋值:CONST(DINGBUTS)
DINGBUTS1:=DDD+1日前的DINGBUTS
GDCS2赋值:CONST(DINGBUTS1)
DINGBU2:=DDD+1日前的DINGBU1
如果 到最后交易的周期>GDCS2返回0否则返回1
输出
高点压力:DRAWLINE( 到最后交易的周期=GDCS2,H, 到最后交易的周期=GDCS1,H,1) 画绿色, 线宽为2
DRAWLINE( 到最后交易的周期=GDCS2,H,ISLASTBAR,GDCS2-1日前的H,1),COLOR0055FF,POINTDOT
DRAWLINE( 到最后交易的周期=GDCS1,H,ISLASTBAR,GDCS1-1日前的H,1),画黄色,POINTDOT
AA1:=LOWN日前的L=2*LOWN+1日内L最低值
QY1:=BACKSET(AA1,LOWN+1)
CC1:=QY1的LOWN过滤 AND L=LOWN+1日内L最低值
DD1赋值:上次CC1距今天数
如果CC1返回 到最后交易的周期否则返回0
YDB赋值:IF(DD1,DD1日前的L,L)
DDTS1:=IF(DD1,DD1日前的DDTS,DDTS)
DDCS1赋值:CONST(DDTS1)
ZDB赋值:DD1+1日前的YDB
DDTS2:=DD1+1日前的DDTS1
DDCS2赋值:CONST(DDTS2)
输出
低点支撑:DRAWLINE( 到最后交易的周期=DDCS2,L, 到最后交易的周期=DDCS1,L,1) 画红色, 线宽为2
ZGSTAR赋值:(高点压力+低点支撑)/2
ZGEND赋值:CONST((高点压力+低点支撑)/2)
如果DDCS2输出
中轨:DRAWLINE( 到最后交易的周期=STARDAY,ZGSTAR,ISLASTBAR,ZGEND,1),COLORFF55BB, 线宽为2
DRAWLINE( 到最后交易的周期=DDCS1,L,ISLASTBAR,DDCS1-1日前的L,1),画洋红色,POINTDOT,
DRAWLINE( 到最后交易的周期=DDCS2,L,ISLASTBAR,DDCS2-1日前的L,1),画青色,POINTDOT
当满足条件1时,在横轴0纵轴0位置书写文字
Z1赋值:STRCAT(HYBLOCK,' ')
Z2赋值:STRCAT(Z1,DYBLOCK)
Z3赋值:STRCAT(Z2,' ')
DRAWTEXT_FIX(1,0.1,0,0,STRCAT(Z3,GNBLOCK)),COLOR0000FF