通达信筹码主图公式
TS:=130;
N:=99;
M:=3;
MT:=3;
M1:=5;
M2:=7;
M3:=21;
M4:=12;
M5:=50;
DA1:=IF(TS>TOTALBARSCOUNT,TOTALBARSCOUNT,TS);
DA:=IF(CURRBARSCOUNT>DA1,0,DA1);
HI:=REFDATE(HHV(H,DA),DATE);
LO:=REFDATE(LLV(L,DA),DATE);
C1:=IF(CURRBARSCOUNT<=DA,C,DRAWNULL);
GZ:=EXP(LN(HI/LO)/10);
LH1:=SUM(IF(C1>=(HI/GZ),V,0),DA);
LH2:=SUM(IF(C1>=(HI/POW(GZ,2)) AND C1<(HI/GZ),V,0),DA);
LH3:=SUM(IF(C1>=(HI/POW(GZ,3)) AND C1<(HI/POW(GZ,2)),V,0),DA);
LH4:=SUM(IF(C1>=(HI/POW(GZ,4)) AND C1<(HI/POW(GZ,3)),V,0),DA);
LH5:=SUM(IF(C1>=(HI/POW(GZ,5)) AND C1<(HI/POW(GZ,4)),V,0),DA);
LH6:=SUM(IF(C1>=(HI/POW(GZ,6)) AND C1<(HI/POW(GZ,5)),V,0),DA);
LH7:=SUM(IF(C1>=(HI/POW(GZ,7)) AND C1<(HI/POW(GZ,6)),V,0),DA);
LH8:=SUM(IF(C1>=(HI/POW(GZ,8)) AND C1<(HI/POW(GZ,7)),V,0),DA);
LH9:=SUM(IF(C1>=(LO*GZ) AND C1<LO*POW(GZ,2),V,0),DA);
LH10:=SUM(IF(C1>=LO AND C1<LO*GZ,V,0),DA);
L1:=REFDATE(HHV(LH1,DA),DATE),LINETHICK0;
L2:=REFDATE(HHV(LH2,DA),DATE),LINETHICK0;
L3:=REFDATE(HHV(LH3,DA),DATE),LINETHICK0;
L4:=REFDATE(HHV(LH4,DA),DATE);
L5:=REFDATE(HHV(LH5,DA),DATE);
L6:=REFDATE(HHV(LH6,DA),DATE);
L7:=REFDATE(HHV(LH7,DA),DATE);
L8:=REFDATE(HHV(LH8,DA),DATE);
L9:=REFDATE(HHV(LH9,DA),DATE);
L10:=REFDATE(HHV(LH10,DA),DATE);
SS:=(L1+L2+L3+L4+L5+L6+L7+L8+L9+L10);
STICKLINE(CEILING(DA*L1/SS)*3>=CURRBARSCOUNT,HI*N/100,(HI/GZ),1,1)COLOR656566,LINETHICK1;
STICKLINE(CEILING(DA*L2/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,1)*N/100,HI/POW(GZ,2),1,1)COLOR656566,LINETHICK1;
STICKLINE(CEILING(DA*L3/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,2)*N/100,HI/POW(GZ,3),1,1)COLOR656566,LINETHICK1;
STICKLINE(CEILING(DA*L4/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,3)*N/100,HI/POW(GZ,4),1,1)COLOR656566,LINETHICK1;
STICKLINE(CEILING(DA*L5/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,4)*N/100,HI/POW(GZ,5),1,1)COLOR656566,LINETHICK1;
STICKLINE(CEILING(DA*L6/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,5)*N/100,HI/POW(GZ,6),1,1)COLOR656566,LINETHICK1;
STICKLINE(CEILING(DA*L7/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,6)*N/100,HI/POW(GZ,7),1,1)COLOR656566,LINETHICK1;
STICKLINE(CEILING(DA*L8/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,2),LO*POW(GZ,3)*N/100,1,1)COLOR656566,LINETHICK1;
STICKLINE(CEILING(DA*L9/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,1),LO*POW(GZ,2)*N/100,1,1)COLOR656566,LINETHICK1;
STICKLINE(CEILING(DA*L10/SS)*3>=CURRBARSCOUNT,LO,LO*POW(GZ,1)*N/100,1,1)COLOR656566,LINETHICK1;
DRAWKLINE(H,O,L,C);JJ:=(CLOSE+HIGH+LOW)/3;
{BS标志}
DRAWICON((ZIG(3,5)>REF(ZIG(3,5),1)) AND (REF(ZIG(3,5),1)<=REF(ZIG(3,5),2))
AND (REF(ZIG(3,5),2)<=REF(ZIG(3,5),3)),LOW*0.98,7);
DRAWICON((ZIG(3,5)<REF(ZIG(3,5),1)) AND (REF(ZIG(3,5),1)>=REF(ZIG(3,5),2))
AND (REF(ZIG(3,5),2)>=REF(ZIG(3,5),3)),HIGH*1.02,8);
VAR1:=ZIG(3,10)<REF(ZIG(3,10),1) AND REF(ZIG(3,10),1)>REF(ZIG(3,10),2);
VAR2:=ZIG(3,10)>REF(ZIG(3,10),1) AND REF(ZIG(3,10),1)<REF(ZIG(3,10),2);
STICKLINE(VAR1,C,O,3,0),COLORYELLOW,LINETHICK2;
STICKLINE(VAR1,C,O,1,0),COLORYELLOW,LINETHICK2;
STICKLINE(VAR1,H,L,0,0),COLORYELLOW,LINETHICK2;
STICKLINE(VAR2,C,O,3,0),COLORFF0FF0,LINETHICK2;
STICKLINE(VAR2,C,O,2,0),COLORFF0FF0,LINETHICK2;
STICKLINE(VAR2,H,L,1,0),COLORFF0FF0,LINETHICK2;
DRAWTEXT(CROSS((REF(HIGH,1)+REF(LOW,1))/2,MA(CLOSE,20)+2*STD(CLOSE,20)),HIGH*1.06,'-落袋为安'),COLORYELLOW;EXP7:EXPMA(CLOSE,M2),COLORWHITE,LINETHICK1;
今日保护价:(REF(C,2)+REF(C,1)+O)/3 ,COLORCC3299,NODRAW;
高区:IF(CURRBARSCOUNT<=60, CONST(IF(ISLASTBAR=1,HHV(H, BARSLAST(CURRBARSCOUNT=60)),1)),DRAWNULL),COLORRED,DOTLINE;
低区:IF(CURRBARSCOUNT<=60, CONST(IF(ISLASTBAR=1,LLV(L, BARSLAST(CURRBARSCOUNT=60)),1)),DRAWNULL),COLORMAGENTA,DOTLINE;
STICKLINE(CCI>=200 AND H>=高区,O,C,3,0),COLORBLUE;
STICKLINE(CCI<=100 AND L<=低区,O,C,3,0),COLORYELLOW;
未来函数检测结果如下:
该公式包含未来函数:ZIG
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
TS赋值:130
N赋值:99
M赋值:3
MT:=3
M1:=5
M2:=7
M3:=21
M4:=12
M5:=50
如果TS>TOTALBARSCOUNT返回TOTALBARSCOUNT否则返回TS
如果 到最后交易的周期>DA1返回0否则返回DA1
HI赋值:REFDATE(DA日内H最高值,DATE)
LO赋值:REFDATE(DA日内L最低值,DATE)
如果 到最后交易的周期<=DA返回C否则返回DRAWNULL
GZ赋值:EXP(LN(HI/LO)/10)
LH1赋值:SUM(IF(C1>=(HI/GZ),V,0),DA)
LH2赋值:SUM(IF(C1>=(HI/POW(GZ,2)) AND C1<(HI/GZ),V,0),DA)
LH3赋值:SUM(IF(C1>=(HI/POW(GZ,3)) AND C1<(HI/POW(GZ,2)),V,0),DA)
LH4赋值:SUM(IF(C1>=(HI/POW(GZ,4)) AND C1<(HI/POW(GZ,3)),V,0),DA)
LH5赋值:SUM(IF(C1>=(HI/POW(GZ,5)) AND C1<(HI/POW(GZ,4)),V,0),DA)
LH6赋值:SUM(IF(C1>=(HI/POW(GZ,6)) AND C1<(HI/POW(GZ,5)),V,0),DA)
LH7赋值:SUM(IF(C1>=(HI/POW(GZ,7)) AND C1<(HI/POW(GZ,6)),V,0),DA)
LH8赋值:SUM(IF(C1>=(HI/POW(GZ,8)) AND C1<(HI/POW(GZ,7)),V,0),DA)
LH9赋值:SUM(IF(C1>=(LO*GZ) AND C1如果C1>=LO AND C1
L1赋值:REFDATE(DA日内LH1最高值,DATE),LINETHICK0
L2赋值:REFDATE(DA日内LH2最高值,DATE),LINETHICK0
L3赋值:REFDATE(DA日内LH3最高值,DATE),LINETHICK0
L4赋值:REFDATE(DA日内LH4最高值,DATE)
L5赋值:REFDATE(DA日内LH5最高值,DATE)
L6赋值:REFDATE(DA日内LH6最高值,DATE)
L7赋值:REFDATE(DA日内LH7最高值,DATE)
L8赋值:REFDATE(DA日内LH8最高值,DATE)
L9赋值:REFDATE(DA日内LH9最高值,DATE)
L10:=REFDATE(DA日内LH10最高值,DATE)
SS赋值:(L1+L2+L3+L4+L5+L6+L7+L8+L9+L10)
STICKLINE(CEILING(DA*L1/SS)*3>= 到最后交易的周期,HI*N/100,(HI/GZ),1,1)COLOR656566,LINETHICK1
STICKLINE(CEILING(DA*L2/SS)*3>= 到最后交易的周期,HI/POW(GZ,1)*N/100,HI/POW(GZ,2),1,1)COLOR656566,LINETHICK1
STICKLINE(CEILING(DA*L3/SS)*3>= 到最后交易的周期,HI/POW(GZ,2)*N/100,HI/POW(GZ,3),1,1)COLOR656566,LINETHICK1
STICKLINE(CEILING(DA*L4/SS)*3>= 到最后交易的周期,HI/POW(GZ,3)*N/100,HI/POW(GZ,4),1,1)COLOR656566,LINETHICK1
STICKLINE(CEILING(DA*L5/SS)*3>= 到最后交易的周期,HI/POW(GZ,4)*N/100,HI/POW(GZ,5),1,1)COLOR656566,LINETHICK1
STICKLINE(CEILING(DA*L6/SS)*3>= 到最后交易的周期,HI/POW(GZ,5)*N/100,HI/POW(GZ,6),1,1)COLOR656566,LINETHICK1
STICKLINE(CEILING(DA*L7/SS)*3>= 到最后交易的周期,HI/POW(GZ,6)*N/100,HI/POW(GZ,7),1,1)COLOR656566,LINETHICK1
STICKLINE(CEILING(DA*L8/SS)*3>= 到最后交易的周期,LO*POW(GZ,2),LO*POW(GZ,3)*N/100,1,1)COLOR656566,LINETHICK1
STICKLINE(CEILING(DA*L9/SS)*3>= 到最后交易的周期,LO*POW(GZ,1),LO*POW(GZ,2)*N/100,1,1)COLOR656566,LINETHICK1
STICKLINE(CEILING(DA*L10/SS)*3>= 到最后交易的周期,LO,LO*POW(GZ,1)*N/100,1,1)COLOR656566,LINETHICK1
DRAWKLINE(H,O,L,C)
JJ赋值:(收盘价+最高价+最低价)/3
{BS标志}
DRAWICON((ZIG(3,5)>REF(ZIG(3,5),1)) AND (REF(ZIG(3,5),1)<=REF(ZIG(3,5),2))
AND (REF(ZIG(3,5),2)<=REF(ZIG(3,5),3)),最低价*0.98,7)
DRAWICON((ZIG(3,5)[=REF(ZIG(3,5),2))]
AND (REF(ZIG(3,5),2)>=REF(ZIG(3,5),3)),最高价*1.02,8)
VAR1赋值:ZIG(3,10)[REF(ZIG(3,10),2)]
VAR2赋值:ZIG(3,10)>REF(ZIG(3,10),1) AND REF(ZIG(3,10),1)[当满足条件VAR1时,在C和O之间画柱状线]
当满足条件VAR1时,在C和O之间画柱状线
当满足条件VAR1时,在H和L之间画柱状线
当满足条件VAR2时,在C和O之间画柱状线
当满足条件VAR2时,在C和O之间画柱状线
当满足条件VAR2时,在H和L之间画柱状线
DRAWTEXT(CROSS((1日前的最高价+1日前的最低价)/2,收盘价的20日简单移动平均+2*收盘价的20估算标准差),最高价*1.06,'-落袋为安'),画黄色
输出EXP7:收盘价的M2日指数移动平均,画白色,LINETHICK1
输出
今日保护价:(2日前的C+1日前的C+O)/3 ,COLORCC3299,NODRAW
输出
高区:IF( 到最后交易的周期<=60, CONST(IF(ISLASTBAR=1,HHV(H, 上次 到最后交易的周期=60距今天数),1)),DRAWNULL),画红色,DOTLINE
输出
低区:IF( 到最后交易的周期<=60, CONST(IF(ISLASTBAR=1,LLV(L, 上次 到最后交易的周期=60距今天数),1)),DRAWNULL),画洋红色,DOTLINE
当满足条件CCI>=200 AND H>=高区时,在O和C之间画柱状线
当满足条件CCI<=100 AND L<=低区时,在O和C之间画柱状线