通达信【穿越时空】主图 指标源码
{K线图着重显示涨跌停}
BK:=IF(INBLOCK('科创板'),0.2,IF(INBLOCK('创业板'),0.2,IF(INBLOCK('ST板块'),0.05,0.1)));
XA_1:=IF(DATE<=1200823,1,0);
旧涨停:=(C>=ZTPRICE(REF(CLOSE,1),0.1) AND C=H) AND XA_1=1;
旧跌停:=(C<=DTPRICE(REF(CLOSE,1),0.1) AND C=L) AND XA_1=1;
涨停:=C>=ZTPRICE(REF(C,1),BK) AND C=H;
跌停:=C<=DTPRICE(REF(C,1),BK) AND C=L;
曾涨停:=(H>=ZTPRICE(REF(C,1),BK) AND C<H) OR (H>=ZTPRICE(REF(CLOSE,1),0.1) AND C<H AND XA_1=1);
曾跌停:=(L<=DTPRICE(REF(C,1),BK) AND C>L) OR (L<=DTPRICE(REF(CLOSE,1),0.1) AND C>L AND XA_1=1);
STICKLINE(旧涨停 AND PERIOD=5,O,C,3,0),COLORFF83FA;
STICKLINE(旧跌停 AND PERIOD=5,O,C,3,0),COLORGREEN;
STICKLINE(涨停 AND PERIOD=5,C,O,3,0),COLORFF00FF;
STICKLINE(跌停 AND PERIOD=5,C,O,3,0),COLORGREEN;
STICKLINE(曾涨停 AND PERIOD=5,H,L,0,0),COLORYELLOW;{涨停后回落}
STICKLINE(曾跌停 AND PERIOD=5,L,H,0,0),COLORGREEN;{跌停后回升}
上线:MA(CLOSE,5),COLORMAGENTA,LINETHICK2;
XA_2:=EMA((EMA(CLOSE,19)+EMA(CLOSE,20)+EMA(CLOSE,21))/3,3);
XA_3:=EMA(XA_2,3);{股票指标网http://}
XA_4:=EMA((EMA(CLOSE,1)+EMA(CLOSE,3)+EMA(CLOSE,5))/3,3);
XA_5:=EMA(EMA(EMA(XA_4,1),2),3);
XA_6:=EMA((EMA(CLOSE,19)+EMA(CLOSE,20)+EMA(CLOSE,21))/3,3);
XA_7:=XA_6-(XA_4-XA_6);
下线:EMA(EMA(EMA(XA_7,1),2),3),COLORGREEN,LINETHICK2;
中线:(上线+下线)/2,DOTLINE,COLOR99EEEE;
XA_8:=150;
XA_9:=3;
XA_10:=REF(HHV(HIGH,XA_8),XA_9);
XA_11:=REF(LLV(LOW,XA_8),XA_9);
XA_12:=XA_10-(XA_10-XA_11)*0.886;
XA_13:=XA_10-(XA_10-XA_11)*0.946;
底二886:REFDATE(XA_12,DATE),DOTLINE,COLORFFCC00;
底一946:REFDATE(XA_13,DATE),COLORBLUE;
DRAWTEXT_FIX(ISLASTBAR,0.005,0.02,0,GNBLOCK),COLORCYAN;
DRAWTEXT_FIX(ISLASTBAR,0.005,0.06,0,EXTERNSTR(0,2)),COLORYELLOW;
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
{K线图着重显示涨跌停}BK赋值:IF(INBLOCK('科创板'),0.2,IF(INBLOCK('创业板'),0.2,IF(INBLOCK('ST板块'),0.05,0.1)))
如果DATE<=1200823返回1否则返回0
旧涨停赋值:(C>=ZTPRICE(1日前的收盘价,0.1) AND C=H) AND XA_1=1
旧跌停赋值:(C<=DTPRICE(1日前的收盘价,0.1) AND C=L) AND XA_1=1
涨停赋值:C>=ZTPRICE(1日前的C,BK) AND C=H
跌停赋值:C<=DTPRICE(1日前的C,BK) AND C=L
曾涨停赋值:(H>=ZTPRICE(1日前的C,BK) AND C=ZTPRICE(1日前的收盘价,0.1) AND C曾跌停赋值:(L<=DTPRICE(1日前的C,BK) AND C>L) OR (L<=DTPRICE(1日前的收盘价,0.1) AND C>L AND XA_1=1)
当满足条件旧涨停 AND PERIOD=5时,在O和C之间画柱状线
当满足条件旧跌停 AND PERIOD=5时,在O和C之间画柱状线
当满足条件涨停 AND PERIOD=5时,在C和O之间画柱状线
当满足条件跌停 AND PERIOD=5时,在C和O之间画柱状线
当满足条件曾涨停 AND PERIOD=5时,在H和L之间画柱状线
当满足条件曾跌停 AND PERIOD=5时,在L和H之间画柱状线
{跌停后回升}上线:收盘价的5日简单移动平均,画洋红色, 线宽为2
XA_2赋值:EMA((EMA(收盘价,19)+EMA(收盘价,20)+EMA(收盘价,21))/3,3)
XA_3赋值:XA_2的3日指数移动平均
{股票指标网HTTP://}XA_4:=EMA((EMA(收盘价,1)+EMA(收盘价,3)+EMA(收盘价,5))/3,3)
XA_5赋值:XA_4的1日指数移动平均,2),3)
XA_6赋值:EMA((EMA(收盘价,19)+EMA(收盘价,20)+EMA(收盘价,21))/3,3)
XA_7赋值:XA_6-(XA_4-XA_6)
输出下线:XA_7的1日指数移动平均,2),3),画绿色, 线宽为2
输出中线:(上线+下线)/2,DOTLINE,COLOR99EEEE
XA_8赋值:150
XA_9赋值:3
XA_10:=REF(XA_8日内最高价最高值,XA_9)
XA_11:=REF(XA_8日内最低价最低值,XA_9)
XA_12:=XA_10-(XA_10-XA_11)*0.886
XA_13:=XA_10-(XA_10-XA_11)*0.946
输出底二886:REFDATE(XA_12,DATE),DOTLINE,COLORFFCC00
输出底一946:REFDATE(XA_13,DATE), 画蓝色
当满足条件ISLASTBAR时,在横轴0.005纵轴0.02位置书写文字
DRAWTEXT_FIX(ISLASTBAR,0.005,0.06,0,EXTERNSTR(0,2)),画黄色