好公式网用指标公式为投资注入科技力量!
您的位置:好公式网大智慧公式趋势主图DZH2改进版指标公式详解 大智慧DZH2

趋势主图DZH2改进版指标公式详解 大智慧DZH2

  • 指标公式类型:大智慧公式
  • 公式推荐星级:
  • 指标公式安全:已通过5款杀毒软件查杀,请放心下载!
  • 公式更新时间:2018-03-05 21:05:21
  • 指标公式标签:DZH2
  • 公式运行环境: WinXP/Win7/Win8/Win10/Win All
  • 指标公式语言:用简体中文编写

指标公式详细说明

好公式网(www.goodgongshi.com)告诉您:当前正要下载:趋势主图DZH2改进版指标公式详解 大智慧DZH2

【趋势主图】dzh2改进版
一,dzh2程序大了(尤其是有多个循环在里)速度较慢,机子不好可用下面的简化

版。

二,有朋友问在k线中穿来穿去的线怎么用法?有人用形象说法叫〈进山〉

〈出山〉。进山被压,出山见天。不是绝对的,自己领会吧。

三,有朋友要求改tdx。tdx的画线函功能有限,很不好用。加上16个输出,

根本作不到的事就不要再提了。



{趋势主图dzh2 原版源码}

input: k(2,0,2),n(10,1,255),p1(3,1,255);
var9q:=c= hhv(c,4)and (ref(c,1)>=ref(c,2) or ref(c,1)>=ref(c,3))
or ref(c,1)=hhv(c,4) and close>=ref(c,2)
or ref(c,2)=hhv(c,4) and ref(c,3)=llv(c,4) and c>=ref(c,1)
or ref(c,3)=hhv(c,4) and c>=ref(c,1) and c>=ref(c,2);
红持:var9q,color0000ff,linethick0;
varaq:=c=hhv(c,4) and ref(c,1)=llv(c,4);
粉变:varaq,colorff99ff,linethick0;
varbq:=c=llv(c,4) and (ref(c,1)<ref(c,2) or ref(c,1)<ref(c,3))
or ref(c,1)=llv(c,4) and c<ref(c,2)
or ref(c,2)=llv(c,4) and ref(c,1)<>hhv(c,4) and c<ref(c,1)
or ref(c,3)=llv(c,4) and c<ref(c,1) and c<ref(c,2);
灰跌:varbq,color888888,linethick0;
varcq:=ref(c,1)=llv(c,4) and c>=ref(c,2) or ref(c,2)=llv(c,4)
and ref(c,1)<=ref(c,3) and ref(c,2)<ref(c,4) and c>=ref(c,1);
绿买:varcq,color00ff00,linethick0;
vardq:=ref(c,1)=hhv(c,4) and c<ref(c,2)
or (ref(c,2)=hhv(c,4) and ref(c,1)>ref(c,3)
or ref(c,3)=hhv(c,4) and ref(c,1)>ref(c,2))
and ref(c,2)>=ref(c,4) and c<ref(c,1);
蓝抛:vardq,colorff9900,linethick0;

gj:=if(c=indexc,(indexc+indexh+indexl+indexo)/4,amount/(v+0.01)/100);
明日阻力:=l+(gj-l)+(c-l);
明日支撑:=l+(c-gj);
今日阻力:ref(明日阻力 , 1),linethick0;
今日支撑:ref(明日支撑 , 1),linethick0;
stickline(barstatus=2and c>=今日阻力,今日阻力,今日阻力,20,0),color0000ff;
stickline(barstatus=2and c<今日阻力,今日阻力,今日阻力,20,0),color00ff00;
stickline(barstatus=2and c>=今日支撑,今日支撑,今日支撑,20,0),colorff00ff;
stickline(barstatus=2and c<今日支撑,今日支撑,今日支撑,20,0),colorff0000;

{m30:ema(c,30);
m60:ema(c,60);}
drawgbklast(close>0,strip(rgb(95,95,95),rgb(0,0,0),0));
if datatype=8 and k=1 then begin
partline(c*2-ref(c,3),c>0),move3,color008888,layer7;
partline(ref(c,1)*2-ref(c,4),c>0),move2,color008800,layer7;
partline(ref(c,2)*2-ref(c,5),c>0),move1,color883388,layer7;
m30:ema(c,30),color660066;
m60:ema(c,60),color000066;
end;
wwj:='';
wyy1:=weekday;
if c>0 then begin;
wwj:=' 星期';
if wyy1=5 then wwj:= wwj+'五';
if wyy1=4 then wwj:= wwj+'四';
if wyy1=3 then wwj:= wwj+'三';
if wyy1=2 then wwj:= wwj+'二';
if wyy1=1 then wwj:= wwj+'一';
end;
wwl:='';
wwh:='';
wyy2:=lmonth;
wyy3:=lday;
if barstatus=2 then www:=' 农历 '+numtostrn(wyy2,0)+'月 '+numtostrn(wyy3,0)+'日';
if barstatus=2 then wwh:=numtostrn(date+1000000,0);
if barstatus=2 then wwl:=wwj;
drawtextrel(20 ,40 ,' '+wwh+wwl+www),linethick3,colorffff80;

drawgbklast(close>0,strip(rgb(95,95,95),rgb(0,0,0),0));
drawtextrel(20,30,'趋势主图'),linethick6,coloryellow;
drawtextrel(200,30,stklabel+' '+stkname),linethick6,colorffff80;
if dispstatus=2 then begin;
var100:='所属板块:';
if inblock('电力')=1 then var100:=var100+' 电力';
if inblock('电脑')=1 then var100:=var100+' 电脑';
if inblock('电器')=1 then var100:=var100+' 电器';
if inblock('电子信息')=1 then var100:=var100+' 电子信息';
if inblock('房地产')=1 then var100:=var100+' 房地产';
if inblock('纺织服装')=1 then var100:=var100+' 纺织服装';
if inblock('钢铁')=1 then var100:=var100+' 钢铁';
if inblock('工程建筑')=1 then var100:=var100+' 工程建筑';
if inblock('供水供气')=1 then var100:=var100+' 供水供气';
if inblock('化工')=1 then var100:=var100+' 化工';
if inblock('化纤')=1 then var100:=var100+' 化纤';
if inblock('机械')=1 then var100:=var100+' 机械';
if inblock('建材')=1 then var100:=var100+' 建材';
if inblock('交通工具')=1 then var100:=var100+' 交通工具';
if inblock('交通设施')=1 then var100:=var100+' 交通设施';
if inblock('教育传媒')=1 then var100:=var100+' 教育传媒';
if inblock('金融')=1 then var100:=var100+' 金融';
if inblock('旅游酒店')=1 then var100:=var100+' 旅游酒店';
if inblock('煤炭石油')=1 then var100:=var100+' 煤炭石油';
if inblock('酿酒食品')=1 then var100:=var100+' 酿酒食品';
if inblock('农林牧渔')=1 then var100:=var100+' 农林牧渔';
if inblock('其他行业')=1 then var100:=var100+' 其他行业';
if inblock('汽车')=1 then var100:=var100+' 汽车';
if inblock('汽配')=1 then var100:=var100+' 汽配';
if inblock('商业连锁')=1 then var100:=var100+' 商业连锁';
if inblock('石化')=1 then var100:=var100+' 石化';
if inblock('通信')=1 then var100:=var100+' 通信';
if inblock('外贸')=1 then var100:=var100+' 外贸';
if inblock('医药')=1 then var100:=var100+' 医药';
if inblock('仪电仪表')=1 then var100:=var100+' 仪电仪表';
if inblock('有色金属')=1 then var100:=var100+' 有色金属';
if inblock('运输物流')=1 then var100:=var100+' 运输物流';
if inblock('造纸印刷')=1 then var100:=var100+' 造纸印刷';
if inblock('安徽')=1 then var100:=var100+' 安徽';
if inblock('北京')=1 then var100:=var100+' 北京';
if inblock('福建')=1 then var100:=var100+' 福建';
if inblock('甘肃')=1 then var100:=var100+' 甘肃';
if inblock('广东')=1 then var100:=var100+' 广东';
if inblock('广西')=1 then var100:=var100+' 广西';
if inblock('贵州')=1 then var100:=var100+' 贵州';
if inblock('海南')=1 then var100:=var100+' 海南';
if inblock('河北')=1 then var100:=var100+' 河北';
if inblock('河南')=1 then var100:=var100+' 河南';
if inblock('黑龙江')=1 then var100:=var100+' 黑龙江';
if inblock('湖北')=1 then var100:=var100+' 湖北';
if inblock('湖南')=1 then var100:=var100+' 湖南';
if inblock('吉林')=1 then var100:=var100+' 吉林';
if inblock('江苏')=1 then var100:=var100+' 江苏';
if inblock('江西')=1 then var100:=var100+' 江西';
if inblock('辽宁')=1 then var100:=var100+' 辽宁';
if inblock('内蒙古')=1 then var100:=var100+' 内蒙古';
if inblock('宁夏')=1 then var100:=var100+' 宁夏';
if inblock('青海')=1 then var100:=var100+' 青海';
if inblock('山东')=1 then var100:=var100+' 山东';
if inblock('山西')=1 then var100:=var100+' 山西';
if inblock('陕西')=1 then var100:=var100+' 陕西';
if inblock('上海')=1 then var100:=var100+' 上海';
if inblock('深圳')=1 then var100:=var100+' 深圳';
if inblock('四川')=1 then var100:=var100+' 四川';
if inblock('天津')=1 then var100:=var100+' 天津';
if inblock('***')=1 then var100:=var100+' ***';
if inblock('新疆')=1 then var100:=var100+' 新疆';
if inblock('云南')=1 then var100:=var100+' 云南';
if inblock('浙江')=1 then var100:=var100+' 浙江';
if inblock('重庆')=1 then var100:=var100+' 重庆';
if inblock('3g')=1 then var100:=var100+' 3g';
if inblock('h股')=1 then var100:=var100+' h股';
if inblock('qfii持股')=1 then var100:=var100+' qfii持股';
if inblock('st')=1 then var100:=var100+' st';
if inblock('奥运')=1 then var100:=var100+' 奥运';
if inblock('创投')=1 then var100:=var100+' 创投';
if inblock('次新股')=1 then var100:=var100+' 次新股';
if inblock('大盘')=1 then var100:=var100+' 大盘';
if inblock('股权改革')=1 then var100:=var100+' 股权改革';
if inblock('股权投资')=1 then var100:=var100+' 股权投资';
end;

{th:=dynainfo(39);}
换手率:=100*v/capital;
rh:=h-l;
r:=dynainfo(13)*100;
if c>0 and dispstatus=2then
drawtextrel(20,840,'当日振幅:'+numtostrn(r,2)+'% '+numtostrn(rh,2)+'元 '+'当前换手率:'+numtostrn(换手率,2)+'%'),colorffffff;

dd5:=finance2( 35);
ss5:=finance2( 37);
ff5:=finance2(18);
gg5:=finance2(3);
hh5:=dynainfo(39);
drawtextrel(20,960,var100),color00ffff;

if c>0 and dispstatus=2then
drawtextrel(20,900,'总股本:'+numtostrn(dd5,0)+'万股' +' 流通a股:'+numtostrn(ss5,0)+'万股'
+' 市盈率:'+numtostrn(hh5,2)+'%'+'每股收益:'+numtostrn(gg5,3)),colorbbffff;

drawgbklast(c>0,strip(rgb(10,60,0),rgb(10,10,0),0));

if datatype>1 then begin;
xxx1:=(c+l+h)/3;
xxx2:ema(xxx1,6),color888888;
xxx3:ema(xxx2,5),color008888;
var1111:=backset(ref(high,2)=hhv(high,5),3);
var2222:=cross(var1111,0.9);
var3333:=backset(ref(low,2)=llv(low,5),3);
var4444:=cross(var3333,0.9);
压力: ref(high,barslast(var2222)), pointdot,colorea91b5;
stickline(close,ref(high,barslast(var2222)),ref(high,barslast(var2222)),5,0),colorea91b5;
支撑: ref(low,barslast(var4444)), pointdot,color00b4ff;
stickline(close,ref(low,barslast(var4444)),ref(low,barslast(var4444)),5,0),color00b4ff;

下档线:=(((close - llv(low,13)) / (hhv(high,13) - llv(low,13))) * 100);
arsv:=sma(下档线,3,1);
ak:=sma(arsv,3,1);
ad:=((3 * arsv) - (2 * ak));
aj12:=(((close - llv(low,55)) / (hhv(high,55) - llv(low,55))) * 100);
arsv24:=sma(aj12,3,1);
ak24:=sma(arsv24,3,1);
ad24:=((3 * arsv24) - (2 * ak24));
撑压位:=if(cross(ad24,ad),high,ref(high,barslast(cross(ad24,ad)))){,linethick2,colorffffff};
底:=llv(high,30){,color00ff00,linethick2};
stickline(barstatus=2 ,撑压位,撑压位,30,1),linethick1,colorffffff;
drawtext(barstatus=2 ,撑压位,' 撑压'),colorffffff,valign1;
stickline(barstatus=2 ,底,底,30,1),color00ff00,linethick1;
drawtext(barstatus=2 ,底,' 底线'),color00ff00,valign0;
end;
stickline(close>open,open,low,0.5,0 ),color0000ff;
stickline(close>open,close,high,0.5 ,0 ),color0000ff;
stickline(open>=close,close,low,0.5 ,0 ),color00ff00;
stickline(open>=close,open,high,0.5 ,0 ),color00ff00;
stickline(open>=close ,close ,open,7,0 ),colorff7700;
stickline(open>=close ,close ,open,6,0 ),colorff9900;
stickline(open>=close ,close ,open,5,0 ),colorffbb00;
stickline(open>=close ,close ,open,4,0 ),colorffcc00;
stickline(open>=close ,close ,open,3,0 ),colorffdd00;
stickline(open>=close ,close ,open,2,0 ),colorffee00;
stickline(open>=close ,close ,open,1,0 ),colorffff00;
stickline(close>open,close,open,7,0) ,color000055;
stickline(close>open,close,open,6,0) ,color000066;
stickline(close>open,close,open,5,0) ,color000077;
stickline(close>open,close,open,4,0) ,color000099;
stickline(close>open,close,open,3,0) ,color0000bb;
stickline(close>open,close,open,2,0) ,color0000dd;
stickline(close>open,close,open,1,0) ,color0000ff;
stickline(var9q,c,(o+c)/2,7,0),color000077;
stickline(var9q,c,(o+c)/2,6,0),color000088;
stickline(var9q,c,(o+c)/2,5,0),color0000aa;
stickline(var9q,c,(o+c)/2,4,0),color0000cc;
stickline(var9q,c,(o+c)/2,2,0),color0000ff;
stickline(var9q,c,(o+c)/2,0,0),colorffffff;

stickline(varaq,c,(o+c)/2,7,0),colorff11ff;
stickline(varaq,c,(o+c)/2,6,0),colorff33ff;
stickline(varaq,c,(o+c)/2,5,0),colorff55ff;
stickline(varaq,c,(o+c)/2,4,0),colorff77ff;
stickline(varaq,c,(o+c)/2,3,0),colorff99ff;
stickline(varaq,c,(o+c)/2,2,0),colorffbbff;
stickline(varaq,c,(o+c)/2,1,0),colorffddff;

stickline(varbq,c,(o+c)/2,7,0),color333333;
stickline(varbq,c,(o+c)/2,6,0),color555555;
stickline(varbq,c,(o+c)/2,5,0),color777777;
stickline(varbq,c,(o+c)/2,4,0),color999999;
stickline(varbq,c,(o+c)/2,3,0),colorbbbbbb;
stickline(varbq,c,(o+c)/2,2,0),colordddddd;
stickline(varbq,c,(o+c)/2,1,0),colorffffff;

stickline(varcq,o,(o+c)/2,7,0),color003300;
stickline(varcq,o,(o+c)/2,6,0),color005500;
stickline(varcq,o,(o+c)/2,5,0),color007700;
stickline(varcq,o,(o+c)/2,4,0),color009900;
stickline(varcq,o,(o+c)/2,3,0),color00bb00;
stickline(varcq,o,(o+c)/2,2,0),color00dd00;
stickline(varcq,o,(o+c)/2,1,0),color00ff00;

stickline(vardq,o,(o+c)/2,7,0),colorff1100;
stickline(vardq,o,(o+c)/2,6,0),colorff3300;
stickline(vardq,o,(o+c)/2,5,0),colorff5500;
stickline(vardq,o,(o+c)/2,4,0),colorff7700;
stickline(vardq,o,(o+c)/2,3,0),colorff9900;
stickline(vardq,o,(o+c)/2,2,0),colorffbb00;
stickline(vardq,o,(o+c)/2,1,0),colorffdd00;

v7:=barstatus=2;
v8:=(ref(high,n) = hhv(high,((2 * n) + 1)));
v9:=filter(v8,n);
va:=backset(v9,(n + 1));
vb:=filter(va,n);
vc:=(vb or v7);
vd:=(ref(low,n) = llv(low,((2 * n) + 1)));
ve:=filter(vd,n);
vf:=backset(ve,(n + 1));
v10:=filter(vf,n);
v11:=(v10 and not(vb));
v12:=backset(vc,(ref(barslast(v11),1) + 1));
v13:=(v12 > ref(v12,1));
v14:=backset(v13,2);
v15:=(v14 > ref(v14,1));
v16:=backset((v15 and (count(vc,(ref(barslast(v11),1) + 2)) = 0)),(ref(barslast(v11),1) + 2));
v17:=(v16 > ref(v16,1));
v18:=backset((v17 and (count(vc,(ref(barslast(v11),1) + 2)) = 0)),(ref(barslast(v11),1) + 2));
v19:=(v18 > ref(v18,1));
v1a:=if(vc,count(v11,(ref(barslast(vc),1) + 1)),0);
v1b:=if(((v1a = 1) and vc),barslast(v15),0);
v1c:=if((vc and (ref(low,barslast(v15)) >= ref(low,barslast(v17)))),barslast(v17),barslast(v15));
v1d:=if(((v1a = 2) and vc),v1c,0);
v1e:=if(((v1a >= 3) and vc),if((vc and (ref(low,v1c) >= ref(low,barslast(v19)))),barslast(v19),v1c),0);
v1f:=((v1b + v1d) + v1e);
v20:=backset(vc,v1f);
v21:=(v20 > ref(v20,1));
v22:=backset(v21,2);
v23:=(v22 > ref(v22,1));
v24:=(v23 or v7);
v25:=backset(v24,(ref(barslast(vc),1) + 1));
v26:=(v25 > ref(v25,1));
v27:=backset(v26,2);
v28:=(v27 > ref(v27,1));
v29:=backset((v28 and (count(v24,(ref(barslast(vc),1) + 2)) = 0)),(ref(barslast(vc),1) + 2));
v2a:=(v29 > ref(v29,1));
v2b:=backset((v2a and (count(v24,(ref(barslast(vc),1) + 2)) = 0)),(ref(barslast(vc),1) + 2));
v2c:=(v2b > ref(v2b,1));
v2d:=if(v24,count(vb,(ref(barslast(v24),1) + 1)),0);
v2e:=if(((v2d = 1) and v24),barslast(v28),0);
v2f:=if((v24 and (ref(high,barslast(v28)) <= ref(high,barslast(v2a)))),barslast(v2a),barslast(v28));
v30:=if(((v2d = 2) and v24),v2f,0);
v3b:=if(((v2d >= 3) and v24),if((v24 and (ref(high,v2f) <= ref(high,barslast(v2c)))),barslast(v2c),v2f),0);
v3c:=((v2e + v30) + v3b);
v3d:=backset(v24,v3c);
v3e:=(v3d > ref(v3d,1));
aa:=backset(v3e,2);
aaa:=(aa > ref(aa,1));
bb:=backset(v7,(barslast(aaa) + 1));
cc1:=(bb > ref(bb,1));
cc:=backset(cc1,(ref(barslast(aaa),1) + 2));
aaa2:=(cc > ref(cc,1));
drawline(k=1 and aaa2,high,k=1 and cc1,high,1),pointdot,color00aaaa;
bb2:=(ref(high,4) = hhv(high,((2 * 4) + 1)));
cc22:=filter(bb2,4);
cc2:=backset(cc22,(4 + 1));
ea:=filter(cc2,4);
eb:=(ea or barstatus=2);
a6:=(ref(low,4) = llv(low,((2 * 4) + 1)));
ee:=filter(a6,4);
ff1:=backset(ee,(4 + 1));
ee2:=filter(ff1,4);
ff2:=(ee2 and not(ea));
ee3:=backset(eb,(ref(barslast(ff2),1) + 1));
ff3:=(ee3 > ref(ee3,1));
js:=backset(ff3,2);
g1:=(js > ref(js,1));
ga:=backset((g1 and (count(eb,(ref(barslast(ff2),1) + 2)) = 0)),(ref(barslast(ff2),1) + 2));
g2:=(ga > ref(ga,1));
g3:=backset((g2 and (count(eb,(ref(barslast(ff2),1) + 2)) = 0)),(ref(barslast(ff2),1) + 2));
gg:=(g3 > ref(g3,1));
ja:=if(eb,count(ff2,(ref(barslast(eb),1) + 1)),0);
jb:=if(((ja = 1) and eb),barslast(g1),0);
jj:=if((eb and (ref(low,barslast(g1)) >= ref(low,barslast(g2)))),barslast(g2),barslast(g1));
ld:=if(((ja = 2) and eb),jj,0);
ld1:=if(((ja >= 3) and eb),if((eb and (ref(low,jj) >= ref(low,barslast(gg)))),barslast(gg),jj),0);
hea:=((jb + ld) + ld1);
heb:=backset(eb,hea);
hee:=(heb > ref(heb,1));
hff1:=backset(hee,2);
hee2:=(hff1 > ref(hff1,1));
hff2:=(hee2 or barstatus=2);
hee3:=backset(hff2,(ref(barslast(eb),1) + 1));
hff3:=(hee3 > ref(hee3,1));
hjs:=backset(hff3,2);
hg1:=(hjs > ref(hjs,1));
hga:=backset((hg1 and (count(hff2,(ref(barslast(eb),1) + 2)) = 0)),(ref(barslast(eb),1) + 2));
hg2:=(hga > ref(hga,1));
hg3:=backset((hg2 and (count(hff2,(ref(barslast(eb),1) + 2)) = 0)),(ref(barslast(eb),1) + 2));
hgg:=(hg3 > ref(hg3,1));
hja:=if(hff2,count(ea,(ref(barslast(hff2),1) + 1)),0);
hjb:=if(((hja = 1) and hff2),barslast(hg1),0);
hjj:=if((hff2 and (ref(high,barslast(hg1)) <= ref(high,barslast(hg2)))),barslast(hg2),barslast(hg1));
hd:=if(((hja = 2) and hff2),hjj,0);
x1:=if(((hja >= 3) and hff2),if((hff2 and (ref(high,hjj) <= ref(high,barslast(hgg)))),barslast(hgg),hjj),0);
x2:=((hjb + hd) + x1);
y1:=backset(hff2,x2);
y2:=(y1 > ref(y1,1));
z1:=backset(y2,2);
z2:=(z1 > ref(z1,1));
uu:=backset(barstatus=2,(barslast(hee2) + 1));
vv:=(uu > ref(uu,1));
ww:=backset(barstatus=2,(barslast(z2) + 1));
xx:=(ww > ref(ww,1));
uu2:=if((barslast(vv) < barslast(xx)),vv,xx);
vv2:=if((barslast(vv) < barslast(xx)),low,high);
drawline(k=1 and uu2,vv2,k=1 and barstatus=2,close,0),pointdot,colorff9900;
ww2:=backset(barstatus=2,(barslast(hee2) + 1));
xx2:=(ww2 > ref(ww2,1));
var246:=backset(xx2,(ref(barslast(hee2),1) + 2));
var247:=(var246 > ref(var246,1));
drawline(k=1 and var247,low, k=1 and xx2,low,1),pointdot,color00ffff;
var249:=backset(barstatus=2,(barslast(z2) + 1));
var250:=(var249 > ref(var249,1));
var251:=backset(var250,(ref(barslast(z2),1) + 2));
var252:=(var251 > ref(var251,1));
drawline(k=1 and var252,high, k=1 and var250,high,1),pointdot,color00ffff;

wn:=p1;{原码 n:=3;}
wa1:=ref(h,wn)=hhv(h,2*wn+1); wb1:=filter(wa1,wn); wc1:=backset(wb1,wn+1); wd1:=filter(wc1,wn);{高点}
wa2:=ref(l,wn)=llv(l,2*wn+1); wb2:=filter(wa2,wn); wc2:=backset(wb2,wn+1); wd2:=filter(wc2,wn);{低点}
we1:=(ref(llv(l,2*wn),1)+ref(hhv(h,2*wn),1))/2; we2:=(h+l)/2;{高低点出现在同一k线上时可作取舍}
wh1:=(wd1 and not(wd2 and we1>=we2)) or dispstatus=2 or barscount(c)=1;
wl1:=(wd2 and not(wd1 and we1<we2));wh2:=wd1 and not(wd2 and we1>=we2);
wx1:=ref(barslast(wh1),1)+1; wf1:=backset(wh1 and count(wl1,wx1)>0,llvbars(if(wl1,l,10000),wx1));
wg1:=wf1>ref(wf1,1); wi1:=backset(wg1,2); wld:=wi1>ref(wi1,1);{过滤后低点}
wl2:=wld or dispstatus=2 or barscount(c)=1;
wx2:=ref(barslast(wl2),1)+1; wf2:=backset(wl2 and count(wh2,wx2)>0,hhvbars(if(wh2,h,0),wx2));
wg2:=wf2>ref(wf2,1); wi2:=backset(wg2,2); whd:=wi2>ref(wi2,1);{过滤后高点}
wr1:=backset(dispstatus=2,barslast(whd)+1); ws1:=wr1>ref(wr1,1); {前一高}
wt1:=backset(dispstatus=2,barslast(wld)+1); wu1:=wt1>ref(wt1,1); {前一低}
wr2:=backset(ws1,ref(barslast(whd),1)+2); ws2:=wr2>ref(wr2,1); {前二高}
wt2:=backset(wu1,ref(barslast(wld),1)+2); wu2:=wt2>ref(wt2,1); {前二低}
wt3:=backset(wu2,ref(barslast(wld),1)+2); wu3:=wt3>ref(wt3,1); {前三低}
wt4:=backset(wu3,ref(barslast(wld),1)+2); wu4:=wt4>ref(wt4,1); {前四低}
wr3:=backset(ws2,ref(barslast(whd),1)+2); ws3:=wr3>ref(wr3,1); {前三高}
wr4:=backset(ws3,ref(barslast(whd),1)+2); ws4:=wr4>ref(wr4,1); {前四高}
drawline(k=2 and ws2,h,k=2 and ws1,h,1),color008888; {★压力1:}
drawline(k=2 and wu2,l,k=2 and wu1,l,1),pointdot,color008888;{★支撑1:}
drawline(k=2 and ws3,h,k=2 and ws2,h,1),color888000; {★压力2:}
drawline(k=2 and wu3,l,k=2 and wu2,l,1),pointdot,color888000;{★支撑2:}
drawline(k=2 and ws4,h,k=2 and ws3,h,1),color0000cc;{★压力3:}
drawline(k=2 and wu4,l,k=2 and wu3,l,1),pointdot,color0000cc;{★支撑3:};


===============================================================

{趋势主图jdzh2改进版,简化版源码}

input:p1(3,1,255);
var9q:=c= hhv(c,4)and (ref(c,1)>=ref(c,2) or ref(c,1)>=ref(c,3))
or ref(c,1)=hhv(c,4) and close>=ref(c,2)
or ref(c,2)=hhv(c,4) and ref(c,3)=llv(c,4) and c>=ref(c,1)
or ref(c,3)=hhv(c,4) and c>=ref(c,1) and c>=ref(c,2);
红持:var9q,color0000ff,linethick0;
varaq:=c=hhv(c,4) and ref(c,1)=llv(c,4);
粉变:varaq,colorff99ff,linethick0;
varbq:=c=llv(c,4) and (ref(c,1)<ref(c,2) or ref(c,1)<ref(c,3))
or ref(c,1)=llv(c,4) and c<ref(c,2)
or ref(c,2)=llv(c,4) and ref(c,1)<>hhv(c,4) and c<ref(c,1)
or ref(c,3)=llv(c,4) and c<ref(c,1) and c<ref(c,2);
灰跌:varbq,color888888,linethick0;
varcq:=ref(c,1)=llv(c,4) and c>=ref(c,2) or ref(c,2)=llv(c,4)
and ref(c,1)<=ref(c,3) and ref(c,2)<ref(c,4) and c>=ref(c,1);
绿买:varcq,color00ff00,linethick0;
vardq:=ref(c,1)=hhv(c,4) and c<ref(c,2)
or (ref(c,2)=hhv(c,4) and ref(c,1)>ref(c,3)
or ref(c,3)=hhv(c,4) and ref(c,1)>ref(c,2))
and ref(c,2)>=ref(c,4) and c<ref(c,1);
蓝抛:vardq,colorff9900,linethick0;

gj:=if(c=indexc,(indexc+indexh+indexl+indexo)/4,amount/(v+0.01)/100);
明日阻力:=l+(gj-l)+(c-l);
明日支撑:=l+(c-gj);
今日阻力:ref(明日阻力 , 1),linethick0,color0000ff;
今日支撑:ref(明日支撑 , 1),linethick0,colorff0000;

if dispstatus=2 then begin;
var100:='所属板块:';
if inblock('电力')=1 then var100:=var100+' 电力';
if inblock('电脑')=1 then var100:=var100+' 电脑';
if inblock('电器')=1 then var100:=var100+' 电器';
if inblock('电子信息')=1 then var100:=var100+' 电子信息';
if inblock('房地产')=1 then var100:=var100+' 房地产';
if inblock('纺织服装')=1 then var100:=var100+' 纺织服装';
if inblock('钢铁')=1 then var100:=var100+' 钢铁';
if inblock('工程建筑')=1 then var100:=var100+' 工程建筑';
if inblock('供水供气')=1 then var100:=var100+' 供水供气';
if inblock('化工')=1 then var100:=var100+' 化工';
if inblock('化纤')=1 then var100:=var100+' 化纤';
if inblock('机械')=1 then var100:=var100+' 机械';
if inblock('建材')=1 then var100:=var100+' 建材';
if inblock('交通工具')=1 then var100:=var100+' 交通工具';
if inblock('交通设施')=1 then var100:=var100+' 交通设施';
if inblock('教育传媒')=1 then var100:=var100+' 教育传媒';
if inblock('金融')=1 then var100:=var100+' 金融';
if inblock('旅游酒店')=1 then var100:=var100+' 旅游酒店';
if inblock('煤炭石油')=1 then var100:=var100+' 煤炭石油';
if inblock('酿酒食品')=1 then var100:=var100+' 酿酒食品';
if inblock('农林牧渔')=1 then var100:=var100+' 农林牧渔';
if inblock('其他行业')=1 then var100:=var100+' 其他行业';
if inblock('汽车')=1 then var100:=var100+' 汽车';
if inblock('汽配')=1 then var100:=var100+' 汽配';
if inblock('商业连锁')=1 then var100:=var100+' 商业连锁';
if inblock('石化')=1 then var100:=var100+' 石化';
if inblock('通信')=1 then var100:=var100+' 通信';
if inblock('外贸')=1 then var100:=var100+' 外贸';
if inblock('医药')=1 then var100:=var100+' 医药';
if inblock('仪电仪表')=1 then var100:=var100+' 仪电仪表';
if inblock('有色金属')=1 then var100:=var100+' 有色金属';
if inblock('运输物流')=1 then var100:=var100+' 运输物流';
if inblock('造纸印刷')=1 then var100:=var100+' 造纸印刷';
if inblock('安徽')=1 then var100:=var100+' 安徽';
if inblock('北京')=1 then var100:=var100+' 北京';
if inblock('福建')=1 then var100:=var100+' 福建';
if inblock('甘肃')=1 then var100:=var100+' 甘肃';
if inblock('广东')=1 then var100:=var100+' 广东';
if inblock('广西')=1 then var100:=var100+' 广西';
if inblock('贵州')=1 then var100:=var100+' 贵州';
if inblock('海南')=1 then var100:=var100+' 海南';
if inblock('河北')=1 then var100:=var100+' 河北';
if inblock('河南')=1 then var100:=var100+' 河南';
if inblock('黑龙江')=1 then var100:=var100+' 黑龙江';
if inblock('湖北')=1 then var100:=var100+' 湖北';
if inblock('湖南')=1 then var100:=var100+' 湖南';
if inblock('吉林')=1 then var100:=var100+' 吉林';
if inblock('江苏')=1 then var100:=var100+' 江苏';
if inblock('江西')=1 then var100:=var100+' 江西';
if inblock('辽宁')=1 then var100:=var100+' 辽宁';
if inblock('内蒙古')=1 then var100:=var100+' 内蒙古';
if inblock('宁夏')=1 then var100:=var100+' 宁夏';
if inblock('青海')=1 then var100:=var100+' 青海';
if inblock('山东')=1 then var100:=var100+' 山东';
if inblock('山西')=1 then var100:=var100+' 山西';
if inblock('陕西')=1 then var100:=var100+' 陕西';
if inblock('上海')=1 then var100:=var100+' 上海';
if inblock('深圳')=1 then var100:=var100+' 深圳';
if inblock('四川')=1 then var100:=var100+' 四川';
if inblock('天津')=1 then var100:=var100+' 天津';
if inblock('***')=1 then var100:=var100+' ***';
if inblock('新疆')=1 then var100:=var100+' 新疆';
if inblock('云南')=1 then var100:=var100+' 云南';
if inblock('浙江')=1 then var100:=var100+' 浙江';
if inblock('重庆')=1 then var100:=var100+' 重庆';
if inblock('3g')=1 then var100:=var100+' 3g';
if inblock('h股')=1 then var100:=var100+' h股';
if inblock('qfii持股')=1 then var100:=var100+' qfii持股';
if inblock('st')=1 then var100:=var100+' st';
if inblock('奥运')=1 then var100:=var100+' 奥运';
if inblock('创投')=1 then var100:=var100+' 创投';
if inblock('次新股')=1 then var100:=var100+' 次新股';
if inblock('大盘')=1 then var100:=var100+' 大盘';
if inblock('股权改革')=1 then var100:=var100+' 股权改革';
if inblock('股权投资')=1 then var100:=var100+' 股权投资';
end;
换手率:=100*v/capital;
rh:=h-l;
r:=dynainfo(13)*100;
if c>0 and dispstatus=2then
drawtextrel(20,840,'当日振幅:'+numtostrn(r,2)+'% '+numtostrn(rh,2)+'元 '+'当前换手率:'+numtostrn(换手率,2)+'%'),colorffffff;
dd5:=finance2( 35);
ss5:=finance2( 37);
ff5:=finance2(18);
gg5:=finance2(3);
hh5:=dynainfo(39);
drawtextrel(20,960,var100),color00ffff;
if c>0 and dispstatus=2then
drawtextrel(20,900,'总股本:'+numtostrn(dd5,0)+'万股' +' 流通a股:'+numtostrn(ss5,0)+'万股'
+' 市盈率:'+numtostrn(hh5,2)+'%'+'每股收益:'+numtostrn(gg5,3)),colorbbffff;
drawgbklast(c>0,strip(rgb(10,60,0),rgb(10,10,0),0));
if datatype>1 then begin;
m30:ema(c,30),color660066;
m60:ema(c,60),color000066;
xxx1:=(c+l+h)/3;
xxx2:ema(xxx1,6),color888888;
xxx3:ema(xxx2,5),color008888;
var1111:=backset(ref(high,2)=hhv(high,5),3);
var2222:=cross(var1111,0.9);
var3333:=backset(ref(low,2)=llv(low,5),3);
var4444:=cross(var3333,0.9);
压力: ref(high,barslast(var2222)), pointdot,colorea91b5;
stickline(close,ref(high,barslast(var2222)),ref(high,barslast(var2222)),5,0),colorea91b5;
支撑: ref(low,barslast(var4444)), pointdot,color00b4ff;
stickline(close,ref(low,barslast(var4444)),ref(low,barslast(var4444)),5,0),color00b4ff;
下档线:=(((close - llv(low,13)) / (hhv(high,13) - llv(low,13))) * 100);
arsv:=sma(下档线,3,1);
ak:=sma(arsv,3,1);
ad:=((3 * arsv) - (2 * ak));
aj12:=(((close - llv(low,55)) / (hhv(high,55) - llv(low,55))) * 100);
arsv24:=sma(aj12,3,1);
ak24:=sma(arsv24,3,1);
ad24:=((3 * arsv24) - (2 * ak24));
撑压位:=if(cross(ad24,ad),high,ref(high,barslast(cross(ad24,ad)))){,linethick2,colorffffff};
底:=llv(high,30){,color00ff00,linethick2};
stickline(barstatus=2 ,撑压位,撑压位,40,1),linethick1,colorffffff;
drawtext(barstatus=2 ,撑压位,' 撑压'),colorffffff,valign1;
stickline(barstatus=2 ,底,底,40,1),color00ff00,linethick1;
drawtext(barstatus=2 ,底,' 底线'),color00ff00,valign0;
stickline(barstatus=2,今日阻力,今日阻力,20,0),color0000ff;
stickline(barstatus=2 ,今日支撑,今日支撑,20,0),colorff0000;
end;
stickline(close>open,open,low,0.5,0 ),color0000ff;
stickline(close>open,close,high,0.5 ,0 ),color0000ff;
stickline(open>=close,close,low,0.5 ,0 ),color00ff00;
stickline(open>=close,open,high,0.5 ,0 ),color00ff00;
stickline(open>=close ,close ,open,7,0 ),colorff7700;
stickline(open>=close ,close ,open,6,0 ),colorff9900;
stickline(open>=close ,close ,open,5,0 ),colorffbb00;
stickline(open>=close ,close ,open,4,0 ),colorffcc00;
stickline(open>=close ,close ,open,3,0 ),colorffdd00;
stickline(open>=close ,close ,open,2,0 ),colorffee00;
stickline(open>=close ,close ,open,1,0 ),colorffff00;
stickline(close>open,close,open,7,0) ,color000055;
stickline(close>open,close,open,6,0) ,color000066;
stickline(close>open,close,open,5,0) ,color000077;
stickline(close>open,close,open,4,0) ,color000099;
stickline(close>open,close,open,3,0) ,color0000bb;
stickline(close>open,close,open,2,0) ,color0000dd;
stickline(close>open,close,open,1,0) ,color0000ff;
stickline(var9q,c,(o+c)/2,7,0),color000077;
stickline(var9q,c,(o+c)/2,6,0),color000088;
stickline(var9q,c,(o+c)/2,5,0),color0000aa;
stickline(var9q,c,(o+c)/2,4,0),color0000cc;
stickline(var9q,c,(o+c)/2,2,0),color0000ff;
stickline(var9q,c,(o+c)/2,0,0),colorffffff;

stickline(varaq,c,(o+c)/2,7,0),colorff11ff;
stickline(varaq,c,(o+c)/2,6,0),colorff33ff;
stickline(varaq,c,(o+c)/2,5,0),colorff55ff;
stickline(varaq,c,(o+c)/2,4,0),colorff77ff;
stickline(varaq,c,(o+c)/2,3,0),colorff99ff;
stickline(varaq,c,(o+c)/2,2,0),colorffbbff;
stickline(varaq,c,(o+c)/2,1,0),colorffddff;

stickline(varbq,c,(o+c)/2,7,0),color333333;
stickline(varbq,c,(o+c)/2,6,0),color555555;
stickline(varbq,c,(o+c)/2,5,0),color777777;
stickline(varbq,c,(o+c)/2,4,0),color999999;
stickline(varbq,c,(o+c)/2,3,0),colorbbbbbb;
stickline(varbq,c,(o+c)/2,2,0),colordddddd;
stickline(varbq,c,(o+c)/2,1,0),colorffffff;

stickline(varcq,o,(o+c)/2,7,0),color003300;
stickline(varcq,o,(o+c)/2,6,0),color005500;
stickline(varcq,o,(o+c)/2,5,0),color007700;
stickline(varcq,o,(o+c)/2,4,0),color009900;
stickline(varcq,o,(o+c)/2,3,0),color00bb00;
stickline(varcq,o,(o+c)/2,2,0),color00dd00;
stickline(varcq,o,(o+c)/2,1,0),color00ff00;

stickline(vardq,o,(o+c)/2,7,0),colorff1100;
stickline(vardq,o,(o+c)/2,6,0),colorff3300;
stickline(vardq,o,(o+c)/2,5,0),colorff5500;
stickline(vardq,o,(o+c)/2,4,0),colorff7700;
stickline(vardq,o,(o+c)/2,3,0),colorff9900;
stickline(vardq,o,(o+c)/2,2,0),colorffbb00;
stickline(vardq,o,(o+c)/2,1,0),colorffdd00;

wn:=p1;{原码 n:=3;}
wa1:=ref(h,wn)=hhv(h,2*wn+1); wb1:=filter(wa1,wn); wc1:=backset(wb1,wn+1); wd1:=filter(wc1,wn);{高点}
wa2:=ref(l,wn)=llv(l,2*wn+1); wb2:=filter(wa2,wn); wc2:=backset(wb2,wn+1); wd2:=filter(wc2,wn);{低点}
we1:=(ref(llv(l,2*wn),1)+ref(hhv(h,2*wn),1))/2; we2:=(h+l)/2;{高低点出现在同一k线上时可作取舍}
wh1:=(wd1 and not(wd2 and we1>=we2)) or dispstatus=2 or barscount(c)=1;
wl1:=(wd2 and not(wd1 and we1<we2));wh2:=wd1 and not(wd2 and we1>=we2);
wx1:=ref(barslast(wh1),1)+1; wf1:=backset(wh1 and count(wl1,wx1)>0,llvbars(if(wl1,l,10000),wx1));
wg1:=wf1>ref(wf1,1); wi1:=backset(wg1,2); wld:=wi1>ref(wi1,1);{过滤后低点}
wl2:=wld or dispstatus=2 or barscount(c)=1;
wx2:=ref(barslast(wl2),1)+1; wf2:=backset(wl2 and count(wh2,wx2)>0,hhvbars(if(wh2,h,0),wx2));
wg2:=wf2>ref(wf2,1); wi2:=backset(wg2,2); whd:=wi2>ref(wi2,1);{过滤后高点}
wr1:=backset(dispstatus=2,barslast(whd)+1); ws1:=wr1>ref(wr1,1); {前一高}
wt1:=backset(dispstatus=2,barslast(wld)+1); wu1:=wt1>ref(wt1,1); {前一低}
wr2:=backset(ws1,ref(barslast(whd),1)+2); ws2:=wr2>ref(wr2,1); {前二高}
wt2:=backset(wu1,ref(barslast(wld),1)+2); wu2:=wt2>ref(wt2,1); {前二低}
wt3:=backset(wu2,ref(barslast(wld),1)+2); wu3:=wt3>ref(wt3,1); {前三低}
wt4:=backset(wu3,ref(barslast(wld),1)+2); wu4:=wt4>ref(wt4,1); {前四低}
wr3:=backset(ws2,ref(barslast(whd),1)+2); ws3:=wr3>ref(wr3,1); {前三高}
wr4:=backset(ws3,ref(barslast(whd),1)+2); ws4:=wr4>ref(wr4,1); {前四高}
drawline(ws2,h,ws1,h,1),color008888; {★压力1:}
drawline(wu2,l,wu1,l,1),pointdot,color008888;{★支撑1:}
drawline(ws3,h,ws2,h,1),color888000; {★压力2:}
drawline(wu3,l,wu2,l,1),pointdot,color888000;{★支撑2:}
drawline(ws4,h,ws3,h,1),color0000cc;{★压力3:}
drawline(wu4,l,wu3,l,1),pointdot,color0000cc;{★支撑3:};


【趋势主图】dzh2改进版

  >>>使用本站搜索工具可以找到更多趋势主图DZH2改进版指标公式详解 大智慧DZH2

指标公式下载地址

点这下载软件
好公式网提供全网最全的指标公式软件,感谢您的支持!鼠标双击图片可看大图!
下载请点击右侧“立即下载”,如只有源码,请点击本页面右侧的导入方法按图导入!
本站指标基于网友分享,仅供研究自学,勿作他用,本站对下载使用不承担任何责任!

指标公式下载注意

    ☉ 好公式网发布的指标公式主要用于软件技术面分析,仅供参考,勿用于实际操作,据此操作风险自负!

    ☉ 解压密码:www.goodgongshi.com 就是好公式网域名,希望大家看清楚,切勿输错。

    ☉ tnc和tni格式指标公式,仅可以用通达信软件引入使用,例如可以用通达信软件引入使用指标公式;

    ☉ tne格式指标公式,仅可以用通达信软件公式编辑器5.0版导入,高版本兼容低版本;

    ☉ fnc格式指标公式,可以用大智慧软件新一代高速行情分析系统股票软件使用,少部分可以用分析家软件引入使用;

    ☉ alg格式指标公式,仅仅可以用飞狐交易师软件引入使用;exp格式指标公式,仅可以用大智慧经典版软件引入使用;

    ☉ hxf格式指标公式,仅可以用同花顺软件引入使用。

    ☉ 如果您发现下载软件链接错误,请联系管理员报告错误。

    ☉ 好公式网欢迎各位网友帮忙宣传转发本站网址,有您的支持,我们会做得更好!

    ☉ 本文趋势主图DZH2改进版指标公式详解 大智慧DZH2仅供学习研究。

猜你喜欢

学了又学