通道主图通达信公式 主图 源码附图
MID_TDMS:=(3*C+L+H)/5;
波动中枢:=EMA(EMA(EMA(MID_TDMS,20),2),2),POINTDOT;
BDUP:=REF(HHV(100*(HIGH-波动中枢)/波动中枢,120),1),NODRAW;
BDDN:=REF(LLV(100*(LOW-波动中枢)/波动中枢,120),1),NODRAW;
顶:=EMA(EMA(EMA(REF(波动中枢,1)*(1+BDUP/100),2),2),2);
底:=EMA(EMA(EMA(REF(波动中枢,1)*(1+BDDN/100),2),2),2);
地线:=底;
中线:=REF(波动中枢,1);
天线:=顶;
绘图范围:=IFF(BARSCOUNT(CLOSE)>120,1,0);
STICKLINE(绘图范围,地线,地线+(中线-地线)*(20/20),11,0),COLOR000000;
STICKLINE(绘图范围,地线,地线+(中线-地线)*(19/20),11,0),COLOR000008;
STICKLINE(绘图范围,地线,地线+(中线-地线)*(18/20),11,0),COLOR000010;
STICKLINE(绘图范围,地线,地线+(中线-地线)*(17/20),11,0),COLOR000018;
STICKLINE(绘图范围,地线,地线+(中线-地线)*(16/20),11,0),COLOR000020;
STICKLINE(绘图范围,地线,地线+(中线-地线)*(15/20),11,0),COLOR000028;
STICKLINE(绘图范围,地线,地线+(中线-地线)*(14/20),11,0),COLOR000030;
STICKLINE(绘图范围,地线,地线+(中线-地线)*(13/20),11,0),COLOR000038;
STICKLINE(绘图范围,地线,地线+(中线-地线)*(12/20),11,0),COLOR000040;
STICKLINE(绘图范围,地线,地线+(中线-地线)*(11/20),11,0),COLOR000048;
STICKLINE(绘图范围,地线,地线+(中线-地线)*(10/20),11,0),COLOR000050;
STICKLINE(绘图范围,地线,地线+(中线-地线)*(9/20),11,0),COLOR000058;
STICKLINE(绘图范围,地线,地线+(中线-地线)*(8/20),11,0),COLOR000060;
STICKLINE(绘图范围,地线,地线+(中线-地线)*(7/20),11,0),COLOR000068;
STICKLINE(绘图范围,地线,地线+(中线-地线)*(6/20),11,0),COLOR000070;
STICKLINE(绘图范围,地线,地线+(中线-地线)*(5/20),11,0),COLOR000078;
STICKLINE(绘图范围,地线,地线+(中线-地线)*(4/20),11,0),COLOR000080;
STICKLINE(绘图范围,地线,地线+(中线-地线)*(3/20),11,0),COLOR000088;
STICKLINE(绘图范围,地线,地线+(中线-地线)*(2/20),11,0),COLOR000090;
STICKLINE(绘图范围,地线,地线+(中线-地线)*(1/20),11,0),COLOR000098;
STICKLINE(绘图范围,天线,天线-(天线-中线)*(20/20),11,0),COLOR000000;
STICKLINE(绘图范围,天线,天线-(天线-中线)*(19/20),11,0),COLOR080800;
STICKLINE(绘图范围,天线,天线-(天线-中线)*(18/20),11,0),COLOR101000;
STICKLINE(绘图范围,天线,天线-(天线-中线)*(17/20),11,0),COLOR181800;
STICKLINE(绘图范围,天线,天线-(天线-中线)*(16/20),11,0),COLOR202000;
STICKLINE(绘图范围,天线,天线-(天线-中线)*(15/20),11,0),COLOR282800;
STICKLINE(绘图范围,天线,天线-(天线-中线)*(14/20),11,0),COLOR303000;
STICKLINE(绘图范围,天线,天线-(天线-中线)*(13/20),11,0),COLOR383800;
STICKLINE(绘图范围,天线,天线-(天线-中线)*(12/20),11,0),COLOR404000;
STICKLINE(绘图范围,天线,天线-(天线-中线)*(11/20),11,0),COLOR484800;
STICKLINE(绘图范围,天线,天线-(天线-中线)*(10/20),11,0),COLOR505000;
STICKLINE(绘图范围,天线,天线-(天线-中线)*(9/20),11,0),COLOR585800;
STICKLINE(绘图范围,天线,天线-(天线-中线)*(8/20),11,0),COLOR606000;
STICKLINE(绘图范围,天线,天线-(天线-中线)*(7/20),11,0),COLOR686800;
STICKLINE(绘图范围,天线,天线-(天线-中线)*(6/20),11,0),COLOR707000;
STICKLINE(绘图范围,天线,天线-(天线-中线)*(5/20),11,0),COLOR787800;
STICKLINE(绘图范围,天线,天线-(天线-中线)*(4/20),11,0),COLOR808000;
STICKLINE(绘图范围,天线,天线-(天线-中线)*(3/20),11,0),COLOR888800;
STICKLINE(绘图范围,天线,天线-(天线-中线)*(2/20),11,0),COLOR909000;
STICKLINE(绘图范围,天线,天线-(天线-中线)*(1/20),11,0),COLOR989800;
回归上限:IFF(绘图范围,天线,DRAWNULL),COLOR989800,LINETHICK2;
回归下限:IFF(绘图范围,地线,DRAWNULL),COLOR000098,LINETHICK2;
上涨偏离度:=100*(HIGH-波动中枢)/波动中枢,NODRAW;
下跌偏离度:=100*(LOW-波动中枢)/波动中枢,NODRAW;
STICKLINE(绘图范围 AND CLOSE>OPEN,HIGH,CLOSE,0,0),COLORRED;
STICKLINE(绘图范围 AND CLOSE>OPEN,LOW,OPEN,0,0),COLORRED;
STICKLINE(绘图范围 AND CLOSE>OPEN,CLOSE,OPEN,3,1),COLORRED;
STICKLINE(绘图范围 AND CLOSE==OPEN,HIGH,LOW,0,0),COLORWHITE;
STICKLINE(绘图范围 AND CLOSE==OPEN,CLOSE,OPEN,3,0),COLORWHITE;
STICKLINE(绘图范围 AND CLOSE<OPEN,HIGH,LOW,0,0),COLORGREEN;
STICKLINE(绘图范围 AND CLOSE<OPEN,CLOSE,OPEN,3,0),COLORGREEN;
波动敞口:((回归上限-波动中枢)/波动中枢+(波动中枢-回归下限)/波动中枢)*100,NODRAW,COLOR00C6FF;
涨过头:=IFF(HIGH>回归上限,1,0);
跌过头:=IFF(LOW<回归下限,1,0);
风险标记:IFF(涨过头,CLOSE,DRAWNULL),NODRAW,COLORCYAN;
机会标记:IFF(跌过头,CLOSE,DRAWNULL),NODRAW,COLORYELLOW;
DRAWICON(涨过头,HIGH*1.01,2);
DRAWICON(跌过头,LOW*0.99,1);
VARC:=SMA(MAX(CLOSE-REF(CLOSE,1),0),6,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),6,1)*100;
逃顶:=IFF(CROSS(84,VARC) AND 上涨偏离度>20,1,0),NODRAW;
VAR1:=(HIGH+LOW+OPEN+2*CLOSE)/5;
VAR2:=REF(VAR1,1);
VAR3:=SMA(MAX(VAR1-VAR2,0),10,1)/SMA(ABS(VAR1-VAR2),10,1)*100;
VAR4:=FILTER(IFF(COUNT(VAR3<20,5)>=1 AND COUNT(VAR1==LLV(VAR1,10),10)>=1 AND CLOSE>=OPEN*1.038 AND VOL>MA(VOL,5)*1.2,1,0),5);
抄底:=IFF(VAR4 AND EXIST(下跌偏离度*(-1)>15,3),1,0);
DRAWICON(绘图范围 AND 逃顶,HIGH*1.02,14);
DRAWICON(绘图范围 AND 抄底,LOW*0.98,13);
DRAWTEXT(绘图范围 AND 逃顶,MAX(H*1.05,回归上限*1.03),'逃'),COLORCYAN;
DRAWTEXT(绘图范围 AND 抄底,MIN(LOW*0.995,回归下限),'抄'),COLORYELLOW;
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
MID_TDMS赋值:(3*C+L+H)/5
波动中枢赋值:MID_TDMS的20日指数移动平均,2),2),POINTDOT
BDUP赋值:REF(HHV(100*(最高价-波动中枢)/波动中枢,120),1),NODRAW
BDDN赋值:REF(LLV(100*(最低价-波动中枢)/波动中枢,120),1),NODRAW
顶赋值:EMA(EMA(EMA(1日前的波动中枢*(1+BDUP/100),2),2),2)
底赋值:EMA(EMA(EMA(1日前的波动中枢*(1+BDDN/100),2),2),2)
地线赋值:底
中线赋值:1日前的波动中枢
天线赋值:顶
绘图范围赋值:IFF(收盘价的有效数据周期数>120,1,0)
STICKLINE(绘图范围,地线,地线+(中线-地线)*(20/20),11,0),COLOR000000
STICKLINE(绘图范围,地线,地线+(中线-地线)*(19/20),11,0),COLOR000008
STICKLINE(绘图范围,地线,地线+(中线-地线)*(18/20),11,0),COLOR000010
STICKLINE(绘图范围,地线,地线+(中线-地线)*(17/20),11,0),COLOR000018
STICKLINE(绘图范围,地线,地线+(中线-地线)*(16/20),11,0),COLOR000020
STICKLINE(绘图范围,地线,地线+(中线-地线)*(15/20),11,0),COLOR000028
STICKLINE(绘图范围,地线,地线+(中线-地线)*(14/20),11,0),COLOR000030
STICKLINE(绘图范围,地线,地线+(中线-地线)*(13/20),11,0),COLOR000038
STICKLINE(绘图范围,地线,地线+(中线-地线)*(12/20),11,0),COLOR000040
STICKLINE(绘图范围,地线,地线+(中线-地线)*(11/20),11,0),COLOR000048
STICKLINE(绘图范围,地线,地线+(中线-地线)*(10/20),11,0),COLOR000050
STICKLINE(绘图范围,地线,地线+(中线-地线)*(9/20),11,0),COLOR000058
STICKLINE(绘图范围,地线,地线+(中线-地线)*(8/20),11,0),COLOR000060
STICKLINE(绘图范围,地线,地线+(中线-地线)*(7/20),11,0),COLOR000068
STICKLINE(绘图范围,地线,地线+(中线-地线)*(6/20),11,0),COLOR000070
STICKLINE(绘图范围,地线,地线+(中线-地线)*(5/20),11,0),COLOR000078
STICKLINE(绘图范围,地线,地线+(中线-地线)*(4/20),11,0),COLOR000080
STICKLINE(绘图范围,地线,地线+(中线-地线)*(3/20),11,0),COLOR000088
STICKLINE(绘图范围,地线,地线+(中线-地线)*(2/20),11,0),COLOR000090
STICKLINE(绘图范围,地线,地线+(中线-地线)*(1/20),11,0),COLOR000098
STICKLINE(绘图范围,天线,天线-(天线-中线)*(20/20),11,0),COLOR000000
STICKLINE(绘图范围,天线,天线-(天线-中线)*(19/20),11,0),COLOR080800
STICKLINE(绘图范围,天线,天线-(天线-中线)*(18/20),11,0),COLOR101000
STICKLINE(绘图范围,天线,天线-(天线-中线)*(17/20),11,0),COLOR181800
STICKLINE(绘图范围,天线,天线-(天线-中线)*(16/20),11,0),COLOR202000
STICKLINE(绘图范围,天线,天线-(天线-中线)*(15/20),11,0),COLOR282800
STICKLINE(绘图范围,天线,天线-(天线-中线)*(14/20),11,0),COLOR303000
STICKLINE(绘图范围,天线,天线-(天线-中线)*(13/20),11,0),COLOR383800
STICKLINE(绘图范围,天线,天线-(天线-中线)*(12/20),11,0),COLOR404000
STICKLINE(绘图范围,天线,天线-(天线-中线)*(11/20),11,0),COLOR484800
STICKLINE(绘图范围,天线,天线-(天线-中线)*(10/20),11,0),COLOR505000
STICKLINE(绘图范围,天线,天线-(天线-中线)*(9/20),11,0),COLOR585800
STICKLINE(绘图范围,天线,天线-(天线-中线)*(8/20),11,0),COLOR606000
STICKLINE(绘图范围,天线,天线-(天线-中线)*(7/20),11,0),COLOR686800
STICKLINE(绘图范围,天线,天线-(天线-中线)*(6/20),11,0),COLOR707000
STICKLINE(绘图范围,天线,天线-(天线-中线)*(5/20),11,0),COLOR787800
STICKLINE(绘图范围,天线,天线-(天线-中线)*(4/20),11,0),COLOR808000
STICKLINE(绘图范围,天线,天线-(天线-中线)*(3/20),11,0),COLOR888800
STICKLINE(绘图范围,天线,天线-(天线-中线)*(2/20),11,0),COLOR909000
STICKLINE(绘图范围,天线,天线-(天线-中线)*(1/20),11,0),COLOR989800
输出
回归上限:IFF(绘图范围,天线,DRAWNULL),COLOR989800, 线宽为2
输出
回归下限:IFF(绘图范围,地线,DRAWNULL),COLOR000098, 线宽为2
上涨偏离度赋值:100*(最高价-波动中枢)/波动中枢,NODRAW
下跌偏离度赋值:100*(最低价-波动中枢)/波动中枢,NODRAW
当满足条件绘图范围 AND 收盘价>开盘价时,在最高价和收盘价之间画柱状线
当满足条件绘图范围 AND 收盘价>开盘价时,在最低价和开盘价之间画柱状线
当满足条件绘图范围 AND 收盘价>开盘价时,在收盘价和开盘价之间画柱状线
当满足条件绘图范围 AND 收盘价==开盘价时,在最高价和最低价之间画柱状线
当满足条件绘图范围 AND 收盘价==开盘价时,在收盘价和开盘价之间画柱状线
当满足条件绘图范围 AND 收盘价<开盘价时,在最高价和最低价之间画柱状线
当满足条件绘图范围 AND 收盘价<开盘价时,在收盘价和开盘价之间画柱状线
输出
波动敞口:((回归上限-波动中枢)/波动中枢+(波动中枢-回归下限)/波动中枢)*100,NODRAW,COLOR00C6FF
涨过头赋值:IFF(最高价>回归上限,1,0)
跌过头赋值:IFF(最低价<回归下限,1,0)
输出
风险标记:IFF(涨过头,收盘价,DRAWNULL),NODRAW,画青色
输出
机会标记:IFF(跌过头,收盘价,DRAWNULL),NODRAW,画黄色
当满足条件涨过头时,在最高价*1.01和2之间画图标
当满足条件跌过头时,在最低价*0.99和1之间画图标
VARC赋值:SMA(收盘价-1日前的收盘价和0较大值,6,1)/SMA(收盘价-1日前的收盘价的绝对值,6,1)*100
逃顶赋值:IFF(84上穿VARC AND 上涨偏离度>20,1,0),NODRAW
VAR1赋值:(最高价+最低价+开盘价+2*收盘价)/5
VAR2赋值:1日前的VAR1
VAR3赋值:SMA(VAR1-VAR2和0较大值,10,1)/SMA(VAR1-VAR2的绝对值,10,1)*100
VAR4赋值:FILTER(IFF(统计5日满足VAR3<20的天数>=1 AND COUNT(VAR1==10日内VAR1最低值,10)>=1 AND 收盘价>=开盘价*1.038 AND 成交量>成交量的5日简单移动平均*1.2,1,0),5)
抄底赋值:IFF(VAR4 AND EXIST(下跌偏离度*(-1)>15,3),1,0)
当满足条件绘图范围 AND 逃顶时,在最高价*1.02和14之间画图标
当满足条件绘图范围 AND 抄底时,在最低价*0.98和13之间画图标
DRAWTEXT(绘图范围 AND 逃顶,H*1.05和回归上限*1.03较大值,'逃'),画青色
DRAWTEXT(绘图范围 AND 抄底,最低价*0.995和回归下限的较小值,'抄'),画黄色