通达信给力叠加k线macd指标公式源码

DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
DIFZ:=EMA(C,12)-EMA(C,26);
DEAZ:=EMA(DIFZ,9);
MACDZ:=8*(DIFZ-DEAZ);
TYNNN:=60;
A1:=REF(HIGH,TYNNN)=HHV(HIGH,2*TYNNN+1); B1:=FILTER(A1,TYNNN);
C1:=BACKSET(B1,TYNNN+1); D1:=FILTER(C1,TYNNN);
A2:=REF(LOW,TYNNN)=LLV(LOW,2*TYNNN+1); B2:=FILTER(A2,TYNNN);
C2:=BACKSET(B2,TYNNN+1); D2:=FILTER(C2,TYNNN);
E1:=(REF(LLV(LOW,2*TYNNN),1)+REF(HHV(HIGH,2*TYNNN),1))/2;
E2:=(HIGH+LOW)/2;
H1:=(D1 AND NOT(D2 AND E1>=E2)) OR ISLASTBAR OR
BARSCOUNT(CLOSE)=1;
L1:=(D2 AND NOT(D1 AND E1<E2));
X1:=REF(BARSLAST(H1),1)+1; F1:=BACKSET(H1 AND
COUNT(L1,X1)>0,LLVBARS(IF(L1,LOW,10000),X1));
G1:=F1>REF(F1,1); I1:=BACKSET(G1,2); LD:=I1>REF(I1,1);
UU:=BACKSET(ISLASTBAR,BARSLAST(LD)+1);
VV:=UU>REF(UU,1);
RCC:=REF(L,BARSLAST(VV));
DRAWBAND(DIFZ*4+RCC,RGB(155,50,50),EMA(DIFZ*4+RCC,9),RGB(0,50,150));{此句4.0以下版本要删除}
STICKLINE((RCC+MACDZ)>RCC AND(RCC+MACDZ)<=REF(RCC+MACDZ,1),RCC,RCC+MACDZ,1,0),COLOR400080;
STICKLINE((RCC+MACDZ)>RCC AND(RCC+MACDZ)>REF(RCC+MACDZ,1),RCC,RCC+MACDZ,1,0),COLOR00FFFF;
STICKLINE((RCC+MACDZ)<=RCC AND(RCC+MACDZ)<=REF(RCC+MACDZ,1),RCC,RCC+MACDZ,1,0),COLOR008080;
STICKLINE((RCC+MACDZ)<=RCC AND(RCC+MACDZ)>REF(RCC+MACDZ,1),RCC,RCC+MACDZ,1,0),COLORC080FF;
DIFF:=IF(C,EMA(DIFZ*4+RCC,9),DRAWNULL),COLORFFFFFF,LINETHICK1;
DEAA:=IF(C,DIFZ*4+RCC,DRAWNULL),COLORRED,LINETHICK1;
变盘:IF(DIFZ<=REF(DIFZ,1),DIFZ*4+RCC,DRAWNULL),COLOR00FFFF,NODRAW;
HH0:=CONST(HHV(H,120))*1;
LL0:=CONST(LLV(L,120))*1;
MM0:=CONST((HH0+LL0)/2);
HH1:=IF(CONST(C)<MM0,LL0-(HH0-LL0)*0.4,LL0-(HH0-LL0)*0.4),COLORRED;
LL1:=LL0;HLMAX:=MAX(HH1,LL1);
HLMIN:=MIN(HH1,LL1);
HLMN1:=(HLMAX+HLMIN)/2;
HLMN2:=(HLMAX-HLMIN);
HLMN3:=HHV(V,250)/2;
HLMN4:=HHV(V,250);
VZ:=(V-HLMN3)*HLMN2/HLMN4+HLMN1;
预测量:IF(CURRBARSCOUNT=1 AND PERIOD=5,VOL*240/FROMOPEN,VOL),COLOR990000,NODRAW;
STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,(0-HLMN3)*HLMN2/HLMN4+HLMN1,(预测量-HLMN3)*HLMN2/HLMN4+HLMN1,2,-1),COLORLIGRAY;
STICKLINE(C>=O,VZ,(0-HLMN3)*HLMN2/HLMN4+HLMN1,1,1),COLOR000099;
STICKLINE(C<O,VZ,(0-HLMN3)*HLMN2/HLMN4+HLMN1,1,0),COLOR999900;
M5:=(MA(V,5)-HLMN3)*HLMN2/HLMN4+HLMN1,COLORFFFFFF;
M10:=(MA(V,10)-HLMN3)*HLMN2/HLMN4+HLMN1,COLOR00FFFF;
DRAWTEXT(CROSS(ZIG(3,10),REF(ZIG(3,10),1)),LOW*0.99,'B') , COLORRED,LINETHICK1;
DRAWTEXT(CROSS(REF(ZIG(3,10),1),ZIG(3,10)),HIGH*1.008,'S') , COLORGREEN,LINETHICK1;

给:=EMA(C,2),COLORRED;
力:=EMA(SLOPE(C,9)*20+C,37);
买:=CROSS(给,力);
卖:=CROSS(力,给);
DRAWICON(买,L*0.97,1);
DRAWTEXT(买,L*0.95,'进攻'),COLORYELLOW;
DRAWICON(卖,H*1.03,2);
DRAWTEXT(卖,H*1.08,'撤退'),COLORWHITE;
STICKLINE(给>=力,LOW,HIGH,0.01,0),COLOR0000DD;
STICKLINE(给>=力,CLOSE,OPEN,2,1),COLORRED;
STICKLINE(给>=力,LOW,HIGH,0.01,0),COLOR0000DD;
STICKLINE(给>=力,CLOSE,OPEN,2,1),COLORRED;
STICKLINE(给<力,LOW,HIGH,0.01,0),COLORFFDD00;
STICKLINE(给<力,CLOSE,OPEN,2,0),COLORFFFF00;
STICKLINE(CROSS(给,力),OPEN,CLOSE,2.5,0),COLORYELLOW;
STICKLINE(CROSS(力,给),OPEN,CLOSE,2.5,0),COLORWHITE;




未来函数检测结果如下:
该公式包含未来函数:ZIG
该公式包含未来函数:BACKSET
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式

DRAWKLINE(最高价,开盘价,最低价,收盘价)
DIFZ赋值:C的12日指数移动平均-C的26日指数移动平均
DEAZ赋值:DIFZ的9日指数移动平均
MACDZ赋值:8*(DIFZ-DEAZ)
TYNNN赋值:60
A1赋值:TYNNN日前的最高价=2*TYNNN+1日内最高价最高值
B1赋值:A1的TYNNN过滤
C1赋值:BACKSET(B1,TYNNN+1)
D1赋值:C1的TYNNN过滤
A2赋值:TYNNN日前的最低价=2*TYNNN+1日内最低价最低值
B2赋值:A2的TYNNN过滤
C2赋值:BACKSET(B2,TYNNN+1)
D2赋值:C2的TYNNN过滤
E1赋值:(REF(2*TYNNN日内最低价最低值,1)+REF(2*TYNNN日内最高价最高值,1))/2
E2赋值:(最高价+最低价)/2
H1赋值:(D1 AND NOT(D2 AND E1>=E2)) OR ISLASTBAR OR 收盘价的有效数据周期数=1
L1赋值:(D2 AND NOT(D1 AND E1 X1赋值:REF(上次H1距今天数,1)+1
如果L1返回最低价否则返回10000
G1赋值:F1>1日前的F1
I1赋值:BACKSET(G1,2)
LD赋值:I1>1日前的I1
UU赋值:BACKSET(ISLASTBAR,上次LD距今天数+1)
VV赋值:UU>1日前的UU
RCC赋值:REF(L,上次VV距今天数)
DRAWBAND(DIFZ*4+RCC,RGB(155,50,50),DIFZ*4+RCC的9日指数移动平均,RGB(0,50,150))
{此句4.0以下版本要删除} STICKLINE((RCC+MACDZ)>RCC AND(RCC+MACDZ)<=1日前的RCC+MACDZ,RCC,RCC+MACDZ,1,0),COLOR400080
STICKLINE((RCC+MACDZ)>RCC AND(RCC+MACDZ)>1日前的RCC+MACDZ,RCC,RCC+MACDZ,1,0),COLOR00FFFF
STICKLINE((RCC+MACDZ)<=RCC AND(RCC+MACDZ)<=1日前的RCC+MACDZ,RCC,RCC+MACDZ,1,0),COLOR008080
STICKLINE((RCC+MACDZ)<=RCC AND(RCC+MACDZ)>1日前的RCC+MACDZ,RCC,RCC+MACDZ,1,0),COLORC080FF
DIFF赋值:IF(C,DIFZ*4+RCC的9日指数移动平均,DRAWNULL),COLORFFFFFF, 线宽为1
如果C返回DIFZ*4+RCC否则返回DRAWNULL
输出变盘:IF(DIFZ<=1日前的DIFZ,DIFZ*4+RCC,DRAWNULL),COLOR00FFFF,NODRAW
HH0赋值:CONST(120日内H最高值)*1
LL0赋值:CONST(120日内L最低值)*1
MM0赋值:CONST((HH0+LL0)/2)
HH1赋值:IF(CONST(C) LL1赋值:LL0
HLMAX赋值:HH1和LL1较大值
HLMIN赋值:HH1和LL1的较小值
HLMN1赋值:(HLMAX+HLMIN)/2
HLMN2赋值:(HLMAX-HLMIN)
HLMN3赋值:250日内V最高值/2
HLMN4赋值:250日内V最高值
VZ赋值:(V-HLMN3)*HLMN2/HLMN4+HLMN1
如果 到最后交易的周期=1 AND 周期类型=5返回成交量*240/FROM开盘价否则返回成交量
STICKLINE( 到最后交易的周期=1 AND 周期类型=5,(0-HLMN3)*HLMN2/HLMN4+HLMN1,(预测量-HLMN3)*HLMN2/HLMN4+HLMN1,2,-1),COLORLIGRAY
STICKLINE(C>=O,VZ,(0-HLMN3)*HLMN2/HLMN4+HLMN1,1,1),COLOR000099
STICKLINE(C M5赋值:(V的5日简单移动平均-HLMN3)*HLMN2/HLMN4+HLMN1,COLORFFFFFF
M10赋值:(V的10日简单移动平均-HLMN3)*HLMN2/HLMN4+HLMN1,COLOR00FFFF
DRAWTEXT(CROSS(ZIG(3,10),REF(ZIG(3,10),1)),最低价*0.99,'B') , 画红色, 线宽为1
DRAWTEXT(CROSS(REF(ZIG(3,10),1),ZIG(3,10)),最高价*1.008,'S') , 画绿色, 线宽为1
给赋值:C的2日指数移动平均,画红色
力赋值:EMA(SLOPE(C,9)*20+C,37)
买赋值:给上穿力
卖赋值:力上穿给
当满足条件买时,在L*0.97和1之间画图标
当满足条件买时,在L*0.95和'进攻'位置书写文字
当满足条件卖时,在H*1.03和2之间画图标
当满足条件卖时,在H*1.08和'撤退'位置书写文字
当满足条件给>=力时,在最低价和最高价之间画柱状线
当满足条件给>=力时,在收盘价和开盘价之间画柱状线
当满足条件给>=力时,在最低价和最高价之间画柱状线
当满足条件给>=力时,在收盘价和开盘价之间画柱状线
当满足条件给<力时,在最低价和最高价之间画柱状线
当满足条件给<力时,在收盘价和开盘价之间画柱状线
STICKLINE(给上穿力,开盘价,收盘价,2.5,0),画黄色
STICKLINE(力上穿给,开盘价,收盘价,2.5,0),画白色


联系我们  |  股朋指标网  |  指标网   |  指标公式  |   加入收藏   |  设为主页

@2005-2023 粤ICP备2023063687号-2 股朋指标网别名指标网仅为互联网文章,所有股票指标公式及文章仅供学习研究,并不构成投资建议,请勿以此为依据进行股票交易,由此引起的投资亏损与本站无关。股朋指标网均来源互联网收集整理,如不慎侵犯了你的权益,请联系我们告知,我们将做删除处理
QQ:88652583 微信 88652583
sitemap站点地图