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

副图撑压划线指标源码

(2016-12-17 12:01:24)
标签:

365

分类: 通达信指标
n:1,100,5
a1:=ref(h,n)=hhv(h,2*n+1);
  b1:=filter(a1,n);
  c1:=backset(b1,n+1);
  d1:=filter(c1,n);{高点}
  a2:=ref(l,n)=llv(l,2*n+1);
  b2:=filter(a2,n);
  c2:=backset(b2,n+1);
  d2:=filter(c2,n);{低点}
  e1:=(ref(llv(l,2*n),1)+ref(hhv(h,2*n),1))/2; e2:=(h+l)/2;{高低点出现在同一k线上时可作取舍}
  h1:=(d1 and not(d2 and e1>=e2)) or barstatus=2 or barscount(c)=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,l,10000),x1));
  g1:=f1>ref(f1,1); i1:=backset(g1,2); ld:=i1>ref(i1,1);{过滤后低点}
  l2:=ld or barstatus=2 or barscount(c)=1;
  x2:=ref(barslast(l2),1)+1; f2:=backset(l2 and count(h2,x2)>0,hhvbars
  (if(h2,h,0),x2));
  g2:=f2>ref(f2,1); i2:=backset(g2,2); hd:=i2>ref(i2,1);{过滤后高点}
  r1:=backset(barstatus=2,barslast(hd)+1); 
 s1:=r1>ref(r1,1); {前一高}
  t1:=backset(barstatus=2,barslast(ld)+1); 
 u1:=t1>ref(t1,1); {前一低}
  r2:=backset(s1,ref(barslast(hd),1)+2); 
 s2:=r2>ref(r2,1); {前二高}
  t2:=backset(u1,ref(barslast(ld),1)+2); 
 u2:=t2>ref(t2,1); {前二低}
  短期压力:drawline(s2,h,s1,h,1),colorred;
  短期支撑:drawline(u2,l,u1,l,1),colorgreen;var1:=amount/vol;
  a:=sma(var1,5,1)-sma(var1,55,1);
  b:=sma((a-sma(a,5,1)),5,1);
  stickline(close>ma(close,5) and a>ref(a,1) and b>ref(b,1),l,h,0,0),color0000ff;
  stickline(close>ma(close,5) and a>ref(a,1) and b>ref(b,1),c,o,2,1),color0000ff;
  stickline(cross(close,ma(close,5)) and a>ref(a,1) and b>ref(b,1),c,o,2,0),color0000ff;
  stickline(closeref(a,1) and b>ref(b,1),l,h,0,0),colorffffff;
  stickline(closeref(a,1) and b>ref(b,1),c,o,2,1),colorffffff;
  前期高位:ref(high,barslast(hd)),color00ff00,pointdot;
  前期低位:ref(low,barslast(ld)),colorff00ff,pointdot;
  stickline(close,前期高位,前期高位,10,0),color00ff00;
  stickline(close,前期低位,前期低位,10,0),colorff00ff;
  stickline(a
  stickline(a
  stickline(a>ref(a,1) and b
  stickline(a>ref(a,1) and b
  stickline(aref(b,1),l,h,0,0),colorffffff;
  stickline(aref(b,1),c,o,2,1),colorffffff;{原文链接:http://www.guhai.com.cn/html/GS/tong-da-xin/42161.html}

0

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

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

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

新浪公司 版权所有