通达信高抛低吸主图
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);
DRAWICON(CC,H*1.02,2);
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);
DRAWICON(CC1,L*0.98,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;
EMA13:=EMA(C,13),COLORWHITE;
EMA21:=EMA(C,21),COLORYELLOW;
EMA34:=EMA(C,34),COLORFF00FF;
EMA60:=MA(C,60),COLORFFCC66;
VAR2:=(2*CLOSE+HIGH+LOW)/4;
VAR3:=IF(YEAR>=2099 AND MONTH>2,0,1);
VAR4:=LLV(LOW,5); VAR5:=HHV(HIGH,4);
散户:=EMA((VAR2-VAR4)/(VAR5-VAR4)*100,4)*VAR3;
庄家:=EMA(0.667*REF(散户,1)+0.333*散户,2)*VAR3;
DRAWTEXT(CROSS(散户,庄家) AND 散户<30,L-0.05,'←低吸'),COLORLIRED;
DRAWTEXT(CROSS(庄家,散户) AND 散户>70,H+0.05,'←高抛'),COLORGREEN;
DRAWICON(CROSS(散户,庄家) AND 散户<30,L-0.05,1);
DRAWICON(CROSS(庄家,散户) AND 散户>70,H+0.05,2);
VAR9:=CLOSE-REF(CLOSE,5);
VARA:=EMA(EMA(VAR9,5),5)/EMA(EMA(ABS(VAR9),5),5);
VARC:=EMA(EMA(VAR9,20),20)/EMA(EMA(ABS(VAR9),20),20);
卖出:=IF(VARA>0 AND CROSS(VARC,VARA),90,100);
DRAWICON(卖出<0,H+0.05,2); 买线:=EMA(CLOSE,2);
卖线:=EMA(SLOPE(CLOSE,21)*20+CLOSE,42);
B1:IF(CROSS(买线,卖线),L-0.02,DRAWNULL),CROSSDOT,LINETHICK3,COLORMAGENTA;
S1:IF(CROSS(80,RSI)*30,H+0.02,DRAWNULL),CROSSDOT,LINETHICK3,COLORYELLOW;
VC:=((CLOSE-MA(CLOSE,6))/MA(CLOSE,6)*100+(CLOSE-MA(CLOSE,24))/MA(CLOSE,24)*100+(CLOSE-MA (CLOSE,32))/MA(CLOSE,32)*100)/3;
S2:=IF(VC>20 AND FILTER(VC< REF(VC,1),5),H+0.02,DRAWNULL),CIRCLEDOT,LINETHICK3,COLORGREEN;
A0:=(L+H+C*2)/4;
A1:EMA(A0,14)COLORBLUE,LINETHICK2;
A2:=EMA(A0,25)COLORLIBLUE,LINETHICK2;
A1X:=(A1-REF(A1,1))/REF(A1,1)*100,NODRAW;
A2X:=(A2-REF(A2,1))/REF(A2,1)*100,NODRAW;
看多:IF(A1X>=0 AND BARSLAST(CROSS(A1X,0))>0,REF((C+O)/2,BARSLAST(CROSS(A1X,0))),DRAWNULL),COLORMAGENTA{,LINETHICK2};
逃顶:IF(A1X<0 AND BARSLAST(CROSS(0,A1X))>0,REF((C+O)/2,BARSLAST(CROSS(0,A1X))),DRAWNULL),COLORCYAN,{LINETHICK2};
买入持股:IF(A1X>=0,A1,DRAWNULL)COLORRED,LINETHICK3;
卖出空仓:IF(A1X<0 AND A2X<0,A1,DRAWNULL)COLORGREEN,LINETHICK3;
STICKLINE(CROSS(A1X,0),H,L,0,0 ),COLOR9933FF;
STICKLINE(CROSS(A1X,0),C,O,3,0 ),COLOR0000CC;
STICKLINE(CROSS(A1X,0),C,O,1,0 ),COLOR0033FF;
STICKLINE(CROSS(0,A1X),L,H,0,0 ),COLOR66CC33;
未来函数检测结果如下:
该公式包含未来函数: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最高值
当满足条件CC时,在H*1.02和2之间画图标
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最低值
当满足条件CC1时,在L*0.98和1之间画图标
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
EMA13赋值:C的13日指数移动平均,画白色
EMA21赋值:C的21日指数移动平均,画黄色
EMA34赋值:C的34日指数移动平均,COLORFF00FF
EMA60赋值:C的60日简单移动平均,COLORFFCC66
VAR2赋值:(2*收盘价+最高价+最低价)/4
如果YEAR>=2099 AND MONTH>2返回0否则返回1
VAR4赋值:5日内最低价最低值
VAR5赋值:4日内最高价最高值
散户赋值:EMA((VAR2-VAR4)/(VAR5-VAR4)*100,4)*VAR3
庄家赋值:E0.667*1日前的散户+0.333*散户的2日简单移动平均*VAR3
DRAWTEXT(散户上穿庄家 AND 散户<30,L-0.05,'←低吸'),COLORLIRED
DRAWTEXT(庄家上穿散户 AND 散户>70,H+0.05,'←高抛'),画绿色
DRAWICON(散户上穿庄家 AND 散户<30,L-0.05,1)
DRAWICON(庄家上穿散户 AND 散户>70,H+0.05,2)
VAR9赋值:收盘价-5日前的收盘价
VARA赋值:VAR9的5日指数移动平均,5)/EMA(EMA(VAR9的绝对值,5),5)
VARC赋值:VAR9的20日指数移动平均,20)/EMA(EMA(VAR9的绝对值,20),20)
卖出赋值:IF(VARA>0 AND VARC上穿VARA,90,100)
当满足条件卖出<0时,在H+0.05和2之间画图标
买线赋值:收盘价的2日指数移动平均
卖线赋值:EMA(SLOPE(收盘价,21)*20+收盘价,42)
输出
B1:IF(买线上穿卖线,L-0.02,DRAWNULL),CROSSDOT, 线宽为3,画洋红色
输出
S1:IF(80上穿RSI*30,H+0.02,DRAWNULL),CROSSDOT, 线宽为3,画黄色
VC赋值:((收盘价-收盘价的6日简单移动平均)/收盘价的6日简单移动平均*100+(收盘价-收盘价的24日简单移动平均)/收盘价的24日简单移动平均*100+(收盘价-MA (收盘价,32))/收盘价的32日简单移动平均*100)/3
S2赋值:IF(VC>20 AND FILTER(VC< 1日前的VC,5),H+0.02,DRAWNULL),CIRCLEDOT, 线宽为3,画绿色
A0赋值:(L+H+C*2)/4
输出
A1:A0的14日指数移动平均 画蓝色, 线宽为2
A2赋值:A0的25日指数移动平均COLORLIBLUE, 线宽为2
A1X:=(A1-1日前的A1)/1日前的A1*100,NODRAW
A2X:=(A2-1日前的A2)/1日前的A2*100,NODRAW
输出
看多:IF(A1X>=0 AND 上次A1X上穿0距今天数>0,REF((C+O)/2,上次A1X上穿0距今天数),DRAWNULL),画洋红色{, 线宽为2}
输出
逃顶:IF(A1X<0 AND 上次0上穿A1X距今天数>0,REF((C+O)/2,上次0上穿A1X距今天数),DRAWNULL),画青色,{ 线宽为2}
如果A1X>=0返回A1否则返回DRAWNULL
如果A1X<0 AND A2X<0返回A1否则返回DRAWNULL
STICKLINE(A1X上穿0,H,L,0,0 ),COLOR9933FF
STICKLINE(A1X上穿0,C,O,3,0 ),COLOR0000CC
STICKLINE(A1X上穿0,C,O,1,0 ),COLOR0033FF
STICKLINE(0上穿A1X,L,H,0,0 ),COLOR66CC33