加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

通达信均线数浪及三角形主图指标公式

(2020-04-27 17:20:22)
分类: 划线源码

X:=30;
D:=60;
M5:=EMA(C,X);
M10:=EMA(C,D);
T:=BARSLAST(CROSS(M5,M10));
ST:=BARSLAST(CROSS(M10,M5));
T1:=SUMBARS(T=0,2);
T2:=SUMBARS(T=0,3);
ST1:=SUMBARS(ST=0,2);
ST2:=SUMBARS(ST=0,3);
H1:=IF(CONST(M5)>CONST(M10),HHV(H,T+1),REF(HHV(H,T+1),ST));
L1:=IF(CONST(M5)
H2:=IF(CONST(M5)>CONST(M10),REF(HHV(H,T+1),ST),REF(HHV(H,T+1),ST1-1));
L2:=IF(CONST(M5)
H3:=IF(CONST(M5)>CONST(M10),REF(HHV(H,T+1),ST1-1),REF(HHV(H,T+1),ST2-1));
L3:=IF(CONST(M5)
TJ1:=CONST(M5)>CONST(M10) AND CURRBARSCOUNT>=CONST(T2) AND CURRBARSCOUNT<=CONST(ST2) AND L=CONST(L3);
TJ2:=CONST(M5)>CONST(M10) AND CURRBARSCOUNT>=CONST(ST1) AND CURRBARSCOUNT<=CONST(T2) AND H=CONST(H3);
TJ3:=CONST(M5)>CONST(M10) AND CURRBARSCOUNT>=CONST(T1) AND CURRBARSCOUNT<=CONST(ST1) AND L=CONST(L2);
TJ4:=CONST(M5)>CONST(M10) AND CURRBARSCOUNT>=CONST(ST) AND CURRBARSCOUNT<=CONST(T1) AND H=CONST(H2);
TJ5:=CONST(M5)>CONST(M10) AND CURRBARSCOUNT>=CONST(T)+1 AND CURRBARSCOUNT<=CONST(ST)+1 AND L=CONST(L1);
TJ6:=CONST(M5)>CONST(M10) AND H=CONST(H1) AND CURRBARSCOUNT<=CONST(ST2);
TJ7:=CONST(M5)=CONST(ST2) AND CURRBARSCOUNT<=CONST(T2) AND H=CONST(H3);
TJ8:=CONST(M5)=CONST(T1) AND CURRBARSCOUNT<=CONST(ST2) AND L=CONST(L3);
TJ9:=CONST(M5)=CONST(ST1) AND CURRBARSCOUNT<=CONST(T1) AND H=CONST(H2);
TJ10:=CONST(M5)=CONST(T) AND CURRBARSCOUNT<=CONST(ST1) AND L=CONST(L2);
TJ11:=CONST(M5)=CONST(ST)+1 AND CURRBARSCOUNT<=CONST(T)+1 AND H=CONST(H1);
TJ12:=CONST(M5)<=CONST(T2);
DRAWLINE(TJ1,L,TJ2,H,0),COLORMAGENTA;
DRAWLINE(TJ2,H,TJ3,L,0),COLORMAGENTA;
DRAWLINE(TJ3,L,TJ4,H,0),COLORMAGENTA;
DRAWLINE(TJ4,H,TJ5,L,0),COLORMAGENTA;
DRAWLINE(TJ5,L,TJ6,H,0),COLORMAGENTA;
DRAWLINE(TJ7,H,TJ8,L,0),COLORGREEN;
DRAWLINE(TJ8,L,TJ9,H,0),COLORGREEN;
DRAWLINE(TJ9,H,TJ10,L,0),COLORGREEN;
DRAWLINE(TJ10,L,TJ11,H,0),COLORGREEN;
DRAWLINE(TJ11,H,TJ12,L,0),COLORGREEN;
HH:=CONST(MAX(MAX(H1,H2),H3));
LL:=CONST(MIN(MIN(L1,L2),L3));
Z:=(HH-LL)/2+LL;
DRAWLINE(TJ7,Z,ISLASTBAR,Z,0),COLORGREEN,DOTLINE;
DRAWTEXT(TJ7,CONST(Z)*1.01,VARCAT(VARCAT('中区价位:',VAR2STR(CONST(Z),2)),'元')),COLORGREEN;
HH1:=CONST(MAX(H1,MAX(H2,H3)));
LL1:=CONST(MIN(MIN(L1,L2),L3));
Z1:=(HH1-LL1)/2+LL1;
DRAWLINE(TJ1,Z1,ISLASTBAR,Z1,0),COLORMAGENTA,DOTLINE;
DRAWTEXT(TJ1,CONST(Z)*1.01,VARCAT(VARCAT('中区价位:',VAR2STR(CONST(Z1),2)),'元')),COLORMAGENTA;
LT:=BARSLAST(L=LLV(L,120));
CT:=CONST(LT)+1;
HT:=FINDHIGHBARS(H,CT,CT,1);
{HH:=FINDHIGH(H,CT,CT,1);
LL:=CONST(REF(L,LT));}
QD:=CURRBARSCOUNT=CT*2;
ZD:=CURRBARSCOUNT=CT;
DRAWLINE(QD,CONST(HH),ISLASTBAR,CONST(HH),0),COLORYELLOW;
DRAWLINE(QD,CONST(HH),ZD,LL,0),COLORYELLOW;
DRAWLINE(ZD,LL,ISLASTBAR,CONST(HH),0),COLORYELLOW;


KT的


X:=30;
D:=60;
M5:=EMA(C,X);
M10:=EMA(C,D);
T:=BARSLAST(CROSS(M5,M10));
ST:=BARSLAST(CROSS(M10,M5));
T1:=SUMBARS(T=0,2);
T2:=SUMBARS(T=0,3);
ST1:=SUMBARS(ST=0,2);
ST2:=SUMBARS(ST=0,3);
H1:=IF(refx(M5,DATACOUNT-BARPOS)>refx(M10,DATACOUNT-BARPOS),HHV(H,T+1),REF(HHV(H,T+1),ST));
L1:=IF(refx(M5,DATACOUNT-BARPOS)
H2:=IF(refx(M5,DATACOUNT-BARPOS)>refx(M10,DATACOUNT-BARPOS),REF(HHV(H,T+1),ST),REF(HHV(H,T+1),ST1-1));
L2:=IF(refx(M5,DATACOUNT-BARPOS)
H3:=IF(refx(M5,DATACOUNT-BARPOS)>refx(M10,DATACOUNT-BARPOS),REF(HHV(H,T+1),ST1-1),REF(HHV(H,T+1),ST2-1));
L3:=IF(refx(M5,DATACOUNT-BARPOS)
TJ1:=refx(M5,DATACOUNT-BARPOS)>refx(M10,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1>=refx(T2,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1<=refx(ST2,DATACOUNT-BARPOS) AND L=refx(L3,DATACOUNT-BARPOS);
TJ2:=refx(M5,DATACOUNT-BARPOS)>refx(M10,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1>=refx(ST1,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1<=refx(T2,DATACOUNT-BARPOS) AND H=refx(H3,DATACOUNT-BARPOS);
TJ3:=refx(M5,DATACOUNT-BARPOS)>refx(M10,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1>=refx(T1,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1<=refx(ST1,DATACOUNT-BARPOS) AND L=refx(L2,DATACOUNT-BARPOS);
TJ4:=refx(M5,DATACOUNT-BARPOS)>refx(M10,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1>=refx(ST,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1<=refx(T1,DATACOUNT-BARPOS) AND H=refx(H2,DATACOUNT-BARPOS);
TJ5:=refx(M5,DATACOUNT-BARPOS)>refx(M10,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1>=refx(T,DATACOUNT-BARPOS)+1 AND DATACOUNT-BARPOS+1<=refx(ST,DATACOUNT-BARPOS)+1 AND L=refx(L1,DATACOUNT-BARPOS);
TJ6:=refx(M5,DATACOUNT-BARPOS)>refx(M10,DATACOUNT-BARPOS) AND H=refx(H1,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1<=refx(ST2,DATACOUNT-BARPOS);
TJ7:=refx(M5,DATACOUNT-BARPOS)=refx(ST2,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1<=refx(T2,DATACOUNT-BARPOS) AND H=refx(H3,DATACOUNT-BARPOS);
TJ8:=refx(M5,DATACOUNT-BARPOS)=refx(T1,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1<=refx(ST2,DATACOUNT-BARPOS) AND L=refx(L3,DATACOUNT-BARPOS);
TJ9:=refx(M5,DATACOUNT-BARPOS)=refx(ST1,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1<=refx(T1,DATACOUNT-BARPOS) AND H=refx(H2,DATACOUNT-BARPOS);
TJ10:=refx(M5,DATACOUNT-BARPOS)=refx(T,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1<=refx(ST1,DATACOUNT-BARPOS) AND L=refx(L2,DATACOUNT-BARPOS);
TJ11:=refx(M5,DATACOUNT-BARPOS)=refx(ST,DATACOUNT-BARPOS)+1 AND DATACOUNT-BARPOS+1<=refx(T,DATACOUNT-BARPOS)+1 AND H=refx(H1,DATACOUNT-BARPOS);
TJ12:=refx(M5,DATACOUNT-BARPOS)<=refx(T2,DATACOUNT-BARPOS);
DRAWLINE(TJ1,L,TJ2,H,0),COLORMAGENTA;
DRAWLINE(TJ2,H,TJ3,L,0),COLORMAGENTA;
DRAWLINE(TJ3,L,TJ4,H,0),COLORMAGENTA;
DRAWLINE(TJ4,H,TJ5,L,0),COLORMAGENTA;
DRAWLINE(TJ5,L,TJ6,H,0),COLORMAGENTA;
DRAWLINE(TJ7,H,TJ8,L,0),COLORGREEN;
DRAWLINE(TJ8,L,TJ9,H,0),COLORGREEN;
DRAWLINE(TJ9,H,TJ10,L,0),COLORGREEN;
DRAWLINE(TJ10,L,TJ11,H,0),COLORGREEN;
DRAWLINE(TJ11,H,TJ12,L,0),COLORGREEN;
HH:=refx(MAX(MAX(H1,H2),H3),DATACOUNT-BARPOS);
LL:=refx(MIN(MIN(L1,L2),L3),DATACOUNT-BARPOS);
Z:=(HH-LL)/2+LL;
DRAWLINE(TJ7,Z,ISLASTBAR,Z,0),COLORGREEN,LINEDOT;
DRAWTEXT(TJ7,refx(Z,DATACOUNT-BARPOS)*1,'中区价位:'+NUMTOSTR(refx(Z,DATACOUNT-BARPOS),2)+'元'),COLORGREEN;
HH1:=refx(MAX(H1,MAX(H2,H3)),DATACOUNT-BARPOS);
LL1:=refx(MIN(MIN(L1,L2),L3),DATACOUNT-BARPOS);
Z1:=(HH1-LL1)/2+LL1;
DRAWLINE(TJ1,Z1,ISLASTBAR,Z1,0),COLORMAGENTA,LINEDOT;
DRAWTEXT(TJ1,refx(Z1,DATACOUNT-BARPOS)*1,'中区价位:'+NUMTOSTR(refx(Z1,DATACOUNT-BARPOS),2)+'元'),COLORMAGENTA;
LT:=BARSLAST(L=LLV(L,120));
CT:=refx(LT,DATACOUNT-BARPOS)+1;
HT:=FINDHIGHBARS(H,CT,CT,1);
HH:=FINDHIGH(H,CT,CT,1);
LL:=refx(REF(L,LT),DATACOUNT-BARPOS);
QD:=DATACOUNT-BARPOS+1=CT*2;
ZD:=DATACOUNT-BARPOS+1=CT;
DRAWLINE(QD,refx(HH,DATACOUNT-BARPOS),ISLASTBAR,refx(HH,DATACOUNT-BARPOS),0),COLORYELLOW;
DRAWLINE(QD,refx(HH,DATACOUNT-BARPOS),ZD,LL,0),COLORYELLOW;
DRAWLINE(ZD,LL,ISLASTBAR,refx(HH,DATACOUNT-BARPOS),0),COLORYELLOW;
AA:=EMA(C,5)>EMA(C,20);
BB:=EMA(C,5)
CC:= EMA(C,5)>EMA(C,10);
CC1:=EMA(C,5)
DD:=C
STICKLINE(AA,H,L,0,0),COLORRED;
STICKLINE(AA,O,C,8,1),COLORRED;
STICKLINE(AA AND DD,O,C,8,0),COLORRED;
STICKLINE(BB,H,L,0,0),COLORGREEN;
STICKLINE(BB,O,C,8,1),COLORGREEN;
STICKLINE(BB AND DD,O,C,8,0),COLORGREEN;
STICKLINE(BB AND CC,H,L,0,1),COLORWHITE;
STICKLINE(BB AND CC,O,C,8,1),COLORWHITE;
STICKLINE(BB AND CC AND DD,O,C,8,0),COLORWHITE;
STICKLINE(AA AND CC1,H,L,0,0),COLORWHITE;
STICKLINE(AA AND CC1,O,C,8,1),COLORWHITE;
STICKLINE(AA AND CC1 AND DD,O,C,8,0),COLORWHITE;

金字塔


X:=30;
D:=60;
M5:=EMA(C,X);
M10:=EMA(C,D);
T:=BARSLAST(CROSS(M5,M10));
ST:=BARSLAST(CROSS(M10,M5));
T1:=SUMBARS(T=0,2);
T2:=SUMBARS(T=0,3);
ST1:=SUMBARS(ST=0,2);
ST2:=SUMBARS(ST=0,3);
H1:=IF(refx(M5,DATACOUNT-BARPOS)>refx(M10,DATACOUNT-BARPOS),HHV(H,T+1),REF(HHV(H,T+1),ST));
L1:=IF(refx(M5,DATACOUNT-BARPOS)
H2:=IF(refx(M5,DATACOUNT-BARPOS)>refx(M10,DATACOUNT-BARPOS),REF(HHV(H,T+1),ST),REF(HHV(H,T+1),ST1-1));
L2:=IF(refx(M5,DATACOUNT-BARPOS)
H3:=IF(refx(M5,DATACOUNT-BARPOS)>refx(M10,DATACOUNT-BARPOS),REF(HHV(H,T+1),ST1-1),REF(HHV(H,T+1),ST2-1));
L3:=IF(refx(M5,DATACOUNT-BARPOS)
TJ1:=refx(M5,DATACOUNT-BARPOS)>refx(M10,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1>=refx(T2,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1<=refx(ST2,DATACOUNT-BARPOS) AND L=refx(L3,DATACOUNT-BARPOS);
TJ2:=refx(M5,DATACOUNT-BARPOS)>refx(M10,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1>=refx(ST1,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1<=refx(T2,DATACOUNT-BARPOS) AND H=refx(H3,DATACOUNT-BARPOS);
TJ3:=refx(M5,DATACOUNT-BARPOS)>refx(M10,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1>=refx(T1,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1<=refx(ST1,DATACOUNT-BARPOS) AND L=refx(L2,DATACOUNT-BARPOS);
TJ4:=refx(M5,DATACOUNT-BARPOS)>refx(M10,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1>=refx(ST,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1<=refx(T1,DATACOUNT-BARPOS) AND H=refx(H2,DATACOUNT-BARPOS);
TJ5:=refx(M5,DATACOUNT-BARPOS)>refx(M10,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1>=refx(T,DATACOUNT-BARPOS)+1 AND DATACOUNT-BARPOS+1<=refx(ST,DATACOUNT-BARPOS)+1 AND L=refx(L1,DATACOUNT-BARPOS);
TJ6:=refx(M5,DATACOUNT-BARPOS)>refx(M10,DATACOUNT-BARPOS) AND H=refx(H1,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1<=refx(ST2,DATACOUNT-BARPOS);
TJ7:=refx(M5,DATACOUNT-BARPOS)=refx(ST2,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1<=refx(T2,DATACOUNT-BARPOS) AND H=refx(H3,DATACOUNT-BARPOS);
TJ8:=refx(M5,DATACOUNT-BARPOS)=refx(T1,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1<=refx(ST2,DATACOUNT-BARPOS) AND L=refx(L3,DATACOUNT-BARPOS);
TJ9:=refx(M5,DATACOUNT-BARPOS)=refx(ST1,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1<=refx(T1,DATACOUNT-BARPOS) AND H=refx(H2,DATACOUNT-BARPOS);
TJ10:=refx(M5,DATACOUNT-BARPOS)=refx(T,DATACOUNT-BARPOS) AND DATACOUNT-BARPOS+1<=refx(ST1,DATACOUNT-BARPOS) AND L=refx(L2,DATACOUNT-BARPOS);
TJ11:=refx(M5,DATACOUNT-BARPOS)=refx(ST,DATACOUNT-BARPOS)+1 AND DATACOUNT-BARPOS+1<=refx(T,DATACOUNT-BARPOS)+1 AND H=refx(H1,DATACOUNT-BARPOS);
TJ12:=refx(M5,DATACOUNT-BARPOS)<=refx(T2,DATACOUNT-BARPOS);
DRAWLINE(TJ1,L,TJ2,H,0),COLORMAGENTA;
DRAWLINE(TJ2,H,TJ3,L,0),COLORMAGENTA;
DRAWLINE(TJ3,L,TJ4,H,0),COLORMAGENTA;
DRAWLINE(TJ4,H,TJ5,L,0),COLORMAGENTA;
DRAWLINE(TJ5,L,TJ6,H,0),COLORMAGENTA;
DRAWLINE(TJ7,H,TJ8,L,0),COLORGREEN;
DRAWLINE(TJ8,L,TJ9,H,0),COLORGREEN;
DRAWLINE(TJ9,H,TJ10,L,0),COLORGREEN;
DRAWLINE(TJ10,L,TJ11,H,0),COLORGREEN;
DRAWLINE(TJ11,H,TJ12,L,0),COLORGREEN;
HH:=refx(MAX(MAX(H1,H2),H3),DATACOUNT-BARPOS);
LL:=refx(MIN(MIN(L1,L2),L3),DATACOUNT-BARPOS);
Z:=(HH-LL)/2+LL;
DRAWLINE(TJ7,Z,ISLASTBAR,Z,0),COLORGREEN,LINEDOT;
DRAWTEXT(TJ7,refx(Z,DATACOUNT-BARPOS)*1,'中区价位:'+NUMTOSTR(refx(Z,DATACOUNT-BARPOS),2)+'元'),COLORGREEN;
HH1:=refx(MAX(H1,MAX(H2,H3)),DATACOUNT-BARPOS);
LL1:=refx(MIN(MIN(L1,L2),L3),DATACOUNT-BARPOS);
Z1:=(HH1-LL1)/2+LL1;
DRAWLINE(TJ1,Z1,ISLASTBAR,Z1,0),COLORMAGENTA,LINEDOT;
DRAWTEXT(TJ1,refx(Z1,DATACOUNT-BARPOS)*1,'中区价位:'+NUMTOSTR(refx(Z1,DATACOUNT-BARPOS),2)+'元'),COLORMAGENTA;
HT:=BARSLAST(H=HHV(H,100));
LT:=BARSLAST(L=LLV(L,100));
CT:=refx(HT,DATACOUNT-BARPOS)+1; 
HH:=refx(REF(H,HT),DATACOUNT-BARPOS);
LL:=refx(REF(L,LT),DATACOUNT-BARPOS);
QD:=DATACOUNT-BARPOS-1=CT*2;
ZD:=DATACOUNT-BARPOS-1=CT;
DRAWLINE(QD,refx(HH,DATACOUNT-BARPOS),ISLASTBAR,refx(HH,DATACOUNT-BARPOS),0),COLORYELLOW;
DRAWLINE(QD,refx(HH,DATACOUNT-BARPOS),ZD,LL,0),COLORYELLOW;
DRAWLINE(ZD,LL,ISLASTBAR,refx(HH,DATACOUNT-BARPOS),0),COLORYELLOW; 

AA:=EMA(C,5)>EMA(C,20);
BB:=EMA(C,5)
CC:= EMA(C,5)>EMA(C,10);
CC1:=EMA(C,5)
DD:=C
STICKLINE(AA,H,L,0,0),COLORRED;
STICKLINE(AA,O,C,9,1),COLORRED;
STICKLINE(AA AND DD,O,C,9,0),COLORRED;
STICKLINE(BB,H,L,0,0),COLORGREEN;
STICKLINE(BB,O,C,9,1),COLORGREEN;
STICKLINE(BB AND DD,O,C,9,0),COLORGREEN;
STICKLINE(BB AND CC,H,L,0,1),COLORWHITE;
STICKLINE(BB AND CC,O,C,9,1),COLORWHITE;
STICKLINE(BB AND CC AND DD,O,C,9,0),COLORWHITE;
STICKLINE(AA AND CC1,H,L,0,0),COLORWHITE;
STICKLINE(AA AND CC1,O,C,9,1),COLORWHITE;
STICKLINE(AA AND CC1 AND DD,O,C,9,0),COLORWHITE;


 

http://www.goodgupiao.com/gupiaogongshi/UploadPic/2017-12/201712712555983779.png

http://www.goodgupiao.com/gupiaogongshi/UploadPic/2017-12/20171271256477523.png


0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有