黄金三角划线黄金分割和三角划线通达信公式 主图 源码附图
N:=10;P:=60;
趋势:ZIG(3,N);
↑:TROUGHBARS(3,N,1),COLOR0000FF,NODRAW;
↓:PEAKBARS(3,N,1),COLOR00FF00,NODRAW;
低:IF(↑=0,C,IF(↓<↑,TROUGH(3,N,1),REF(TROUGH(3,N,1),1))),COLOR00FFFF,NODRAW;
涨%:IF(↑<↓,(C/低-1)*100,REF((C/低-1)*100,↓)),COLOR0000FF,NODRAW;
高:IF(↓=0,C,IF(↑<↓,PEAK(3,N,1),REF(PEAK(3,N,1),1))),COLOR00FF00,NODRAW;
跌%:IF(↓<↑,(C/高-1)*100,REF((C/高-1)*100,↑)),COLORFFFF00,NODRAW;
{以下设置主图显示方式股票指标网 }
上:IF(趋势>REF(趋势,1),趋势,DRAWNULL),COLORRED,LINETHICK2;
下:IF(趋势<REF(趋势,1),趋势,DRAWNULL),COLORGREEN,LINETHICK2;
STICKLINE(↑=0,H*1.01,高,0,0),COLOR00FF00;
STICKLINE(↓=0,L*0.99,低,0,0),COLORFF00FF;
STICKLINE(BETWEEN(↑,0,7),低,低,3,1),COLOR00FFFF;
STICKLINE(BETWEEN(↓,0,7),高,高,3,1),COLOR00FF00;
STICKLINE(↑<↓,低,低,1,1),COLOR00FFFF;
STICKLINE(↓<↑,高,高,1,1),COLOR00FF00;
{以下设置黄金分割}
KJ:=高-低;
H1:高-KJ*0.191,COLOR00FFFF,NODRAW;
H2:高-KJ*0.382,COLOR0000FF,NODRAW;
H3:高-KJ*0.500,COLORFFFFFF,NODRAW;
H4:高-KJ*0.618,COLORFF00FF,NODRAW;
H5:高-KJ*0.809,COLOR00FF00,NODRAW;
STICKLINE(↑<↓ AND ↑>0 AND 趋势<高,高,高,1,1),COLOR00FF00;
STICKLINE(↑<↓ AND ↑>0 AND 趋势<H1,H1,H1,1,1),COLOR00FF00;
STICKLINE(↑<↓ AND ↑>0 AND 趋势<H2,H2,H2,1,1),COLOR00FF00;
STICKLINE(↑<↓ AND ↑>0 AND 趋势<H3,H3,H3,1,1),COLORFFFFFF;
STICKLINE(↑<↓ AND ↑>0 AND 趋势<H4,H4,H4,1,1),COLOR00FF00;
STICKLINE(↑<↓ AND ↑>0 AND 趋势<H5,H5,H5,1,1),COLOR00FF00;
STICKLINE(↓<↑ AND ↓>0 AND 趋势>H1,H1,H1,1,1),COLORFF00FF;
STICKLINE(↓<↑ AND ↓>0 AND 趋势>H2,H2,H2,1,1),COLORFF00FF;
STICKLINE(↓<↑ AND ↓>0 AND 趋势>H3,H3,H3,1,1),COLORFFFFFF;
STICKLINE(↓<↑ AND ↓>0 AND 趋势>H4,H4,H4,1,1),COLORFF00FF;
STICKLINE(↓<↑ AND ↓>0 AND 趋势>H5,H5,H5,1,1),COLORFF00FF;
STICKLINE(↓<↑ AND ↓>0 AND 趋势>低,低,低,1,1),COLORFF00FF;
ZHSJ:=IF(↓<↑,BACKSET(ISLASTBAR,↓),IF(↑<↓,BACKSET(ISLASTBAR,↑),0));
DRAWTEXT(↓<↑ AND CROSS(ZHSJ,0.1),H1,'险'),COLOR00FFFF;
DRAWTEXT(↓<↑ AND CROSS(ZHSJ,0.1),H2,'高'),COLOR00FFFF;
DRAWTEXT(↓<↑ AND CROSS(ZHSJ,0.1),H3,'中'),COLOR00FF00;
DRAWTEXT(↓<↑ AND CROSS(ZHSJ,0.1),H4,'低'),COLOR00FFFF;
DRAWTEXT(↓<↑ AND CROSS(ZHSJ,0.1),H5,'支'),COLOR00FFFF;
DRAWTEXT(↓>↑ AND CROSS(ZHSJ,0.1),H1,'压'),COLORFFFFFF;
DRAWTEXT(↓>↑ AND CROSS(ZHSJ,0.1),H2,'高'),COLORFFFFFF;
DRAWTEXT(↓>↑ AND CROSS(ZHSJ,0.1),H3,'中'),COLOR0000FF;
DRAWTEXT(↓>↑ AND CROSS(ZHSJ,0.1),H4,'低'),COLORFFFFFF;
DRAWTEXT(↓>↑ AND CROSS(ZHSJ,0.1),H5,'弹'),COLORFFFFFF;
来函数检测结果如下:
该公式包含未来函数:ZIG
该公式包含未来函数:PEAK
该公式包含未来函数:PEAKBARS
该公式包含未来函数:TROUGH
该公式包含未来函数:TROUGHBARS
该公式包含未来函数:BACKSET
解密、定制、编写公式指标请联系QQ或微信同号:88652583
置顶指标
相关指标公式
N赋值:10
P赋值:60
输出趋势:收盘价N%的之字转向
输出↑:收盘价N%之字转向的前1个波谷位置,COLOR0000FF,NODRAW
输出↓:收盘价N%之字转向的前1个波峰位置,COLOR00FF00,NODRAW
输出低:如果↑=0,返回收盘价,否则返回如果↓<↑,返回收盘价N%之字转向的前1个波谷值,否则返回1日前的收盘价N%之字转向的前1个波谷值,COLOR00FFFF,NODRAW
输出涨%:如果↑<↓,返回(收盘价/低-1)*100,否则返回↓日前的(收盘价/低-1)*100,COLOR0000FF,NODRAW
输出高:如果↓=0,返回收盘价,否则返回如果↑<↓,返回收盘价N%之字转向的前1个波峰值,否则返回1日前的收盘价N%之字转向的前1个波峰值,COLOR00FF00,NODRAW
输出跌%:如果↓<↑,返回(收盘价/高-1)*100,否则返回↑日前的(收盘价/高-1)*100,COLORFFFF00,NODRAW
输出上:如果趋势>1日前的趋势,返回趋势,否则返回无效数,画红色,线宽为2
输出下:如果趋势<1日前的趋势,返回趋势,否则返回无效数,画绿色,线宽为2
当满足条件↑=0时,在最高价*1.01和高位置之间画柱状线,宽度为0,0不为0则画空心柱.,COLOR00FF00
当满足条件↓=0时,在最低价*0.99和低位置之间画柱状线,宽度为0,0不为0则画空心柱.,COLORFF00FF
当满足条件↑位于0和7之间时,在低和低位置之间画柱状线,宽度为3,1不为0则画空心柱.,COLOR00FFFF
当满足条件↓位于0和7之间时,在高和高位置之间画柱状线,宽度为3,1不为0则画空心柱.,COLOR00FF00
当满足条件↑<↓时,在低和低位置之间画柱状线,宽度为1,1不为0则画空心柱.,COLOR00FFFF
当满足条件↓<↑时,在高和高位置之间画柱状线,宽度为1,1不为0则画空心柱.,COLOR00FF00
KJ赋值:高-低
输出H1:高-KJ*0.191,COLOR00FFFF,NODRAW
输出H2:高-KJ*0.382,COLOR0000FF,NODRAW
输出H3:高-KJ*0.500,COLORFFFFFF,NODRAW
输出H4:高-KJ*0.618,COLORFF00FF,NODRAW
输出H5:高-KJ*0.809,COLOR00FF00,NODRAW
当满足条件↑<↓AND↑>0AND趋势<高时,在高和高位置之间画柱状线,宽度为1,1不为0则画空心柱.,COLOR00FF00
当满足条件↑<↓AND↑>0AND趋势当满足条件↑<↓AND↑>0AND趋势当满足条件↑<↓AND↑>0AND趋势当满足条件↑<↓AND↑>0AND趋势当满足条件↑<↓AND↑>0AND趋势当满足条件↓<↑AND↓>0AND趋势>H1时,在H1和H1位置之间画柱状线,宽度为1,1不为0则画空心柱.,COLORFF00FF
当满足条件↓<↑AND↓>0AND趋势>H2时,在H2和H2位置之间画柱状线,宽度为1,1不为0则画空心柱.,COLORFF00FF
当满足条件↓<↑AND↓>0AND趋势>H3时,在H3和H3位置之间画柱状线,宽度为1,1不为0则画空心柱.,COLORFFFFFF
当满足条件↓<↑AND↓>0AND趋势>H4时,在H4和H4位置之间画柱状线,宽度为1,1不为0则画空心柱.,COLORFF00FF
当满足条件↓<↑AND↓>0AND趋势>H5时,在H5和H5位置之间画柱状线,宽度为1,1不为0则画空心柱.,COLORFF00FF
当满足条件↓<↑AND↓>0AND趋势>低时,在低和低位置之间画柱状线,宽度为1,1不为0则画空心柱.,COLORFF00FF
ZHSJ赋值:如果↓<↑,返回若是否最后一个周期则将最近↓周期置为1,否则返回如果↑<↓,返回若是否最后一个周期则将最近↑周期置为1,否则返回0
当满足条件↓<↑ANDCROSS(ZHSJ,0.1)时,在H1位置书写文字,COLOR00FFFF
当满足条件↓<↑ANDCROSS(ZHSJ,0.1)时,在H2位置书写文字,COLOR00FFFF
当满足条件↓<↑ANDCROSS(ZHSJ,0.1)时,在H3位置书写文字,COLOR00FF00
当满足条件↓<↑ANDCROSS(ZHSJ,0.1)时,在H4位置书写文字,COLOR00FFFF
当满足条件↓<↑ANDCROSS(ZHSJ,0.1)时,在H5位置书写文字,COLOR00FFFF
当满足条件↓>↑ANDCROSS(ZHSJ,0.1)时,在H1位置书写文字,COLORFFFFFF
当满足条件↓>↑ANDCROSS(ZHSJ,0.1)时,在H2位置书写文字,COLORFFFFFF
当满足条件↓>↑ANDCROSS(ZHSJ,0.1)时,在H3位置书写文字,COLOR0000FF
当满足条件↓>↑ANDCROSS(ZHSJ,0.1)时,在H4位置书写文字,COLORFFFFFF
当满足条件↓>↑ANDCROSS(ZHSJ,0.1)时,在H5位置书写文字,COLORFFFFFF