ihzx 发表于 2021-8-21 14:02:32

主黄金线主图(大智慧)

<p>内容丰富:有个股所属板块、大盘涨跌家数、黄金分割线、市场成本线、彩色K线(黄色涨停,兰色跌停)、短波顶低信号提示、股价上穿成本线有笑脸、支撑和压力参考值、买入卖出天数等。</p>
<p>{主黄金线}<br />
input:K(1,1,3);            <br />
T:=BARSLAST(DISPSTATUS=1)+1;<br />
A:=DISPSTATUS=2;HH:=HHV(H, T);LL:=LLV(L, T);HL:=HH-LL;wH:=HHVBARS(H, T);wL:=LLVBARS(L, T);<br />
KK:=wH-wL;mHL:=HH-HL*0.5;<br />
if K=1 then begin<br />
HL191:=(HH-LL)*0.191;HL382:=(HH-LL)*0.382;HL618:=(HH-LL)*0.618;HL809:=(HH-LL)*0.809;<br />
if KK&lt;0 then begin<br />
a1:=HH-HL191;a2:=HH-HL382;a3:=HH-HL618;a4:=HH-HL809;<br />
end else begin<br />
a1:=LL+HL191;a2:=LL+HL382;a3:=LL+HL618;a4:=LL+HL809;<br />
end end<br />
if k=1 then begin<br />
HL125:=(HH-LL)*0.125;HL250:=(HH-LL)*0.25;HL375:=(HH-LL)*0.375;HL625:=(HH-LL)*0.625;HL750:=(HH-LL)*0.75;HL875:=(HH-LL)*0.875;<br />
if kk&lt;0 then begin<br />
b1:=HH-HL125;b2:=HH-HL250;b3:=HH-HL375;b4:=HH-HL625;b5:=HH-HL750;b6:=HH-HL875;<br />
end else begin<br />
b1:=LL+HL125;b2:=LL+HL250;b3:=LL+HL375;b4:=LL+HL625;b5:=LL+HL750;b6:=LL+HL875;<br />
end end   <br />
DRAWTEXT(A and K&lt;&gt;3,HH, '最高价:'+HH),ALIGN2,ColorFF00FF;<br />
DRAWTEXT(A and K&lt;&gt;3,LL, '最低价:'+ll),ALIGN2,VALIGN2,Color00FF00;<br />
DRAWTEXT(A and K&lt;&gt;3,mHL,'50%:'+mHL),ALIGN2,ColorFF8000;<br />
DRAWTEXT(A and K=1, a1, '0.191:'+NUMTOSTRN(a1,2)),AL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̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄'),ALIGN2,ColorFF8000,linethick7;<br />
DRAWTEXT(A and K=1, a1, '﹊﹊ ﹊ ﹊ ﹊ ﹊﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊﹊ ﹊ ﹊﹊'),ALIGN2,color208FFF,linethick0;<br />
DRAWTEXT(A and K=1, a2, '﹊ ﹊﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊﹊'),ALIGN2,color208FFF,linethick0;<br />
DRAWTEXT(A and K=1, a3, '﹊ ﹊﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊﹊﹊'),ALIGN2,color208FFF,linethick0;<br />
DRAWTEXT(A and K=1, a4, '﹊ ﹊﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊ ﹊﹊﹊'),ALIGN2,color208FFF,linethick0;<br />
DRAWTEXT(A and K=1, b1, '﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉'),ALIGN2,ColorC0C0C0;<br />
DRAWTEXT(A and K=1, b2, '﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉'),ALIGN2,ColorC0C0C0;<br />
DRAWTEXT(A and K=1, b5, '﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉'),ALIGN2,ColorC0C0C0;<br />
DRAWTEXT(A and K=1, b6, '﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉'),ALIGN2,ColorC0C0C0;<br />
市场成本:DMA(AMOUNT/V/100,V/CAPITAL),Color0080FF,LINETHICK1;<br />
DRAWICON(CROSS(C,市场成本),L,1),ALIGN1;<br />
PT:= REF(HIGH,1)-REF(LOW,1);<br />
重心:=(HIGH + LOW + CLOSE)/3;<br />
压力Ⅰ:=2*重心-LOW;压力Ⅱ:= 重心 + PT;<br />
支撑Ⅰ:=2*重心-HIGH;支撑Ⅱ:= 重心 - PT;<br />
DRAWTEXTABS(50,68,'重心:'+重心),Color208FFF;<br />
DRAWTEXTABS(20,87,'   支撑'),Color00FF00;<br />
DRAWTEXTABS(20,104,'   '+支撑Ⅰ),Color00FF00;<br />
DRAWTEXTABS(20,122,'   '+支撑Ⅱ),Color00FF00;<br />
DRAWTEXTABS(25,87,'         压力'),ColorFF00FF;<br />
DRAWTEXTABS(25,104,'         '+压力Ⅰ),ColorFF00FF;<br />
DRAWTEXTABS(25,122,'         '+压力Ⅱ),ColorFF00FF;<br />
DRAWTEXTABS(25,65,'│'),Color00FFFF;<br />
DRAWTEXTABS(25,77,'│'),Color00FFFF;<br />
DRAWTEXTABS(25,89,'│'),Color00FFFF;<br />
DRAWTEXTABS(25,101,'│'),Color00FFFF;<br />
DRAWTEXTABS(25,113,'│'),Color00FFFF;<br />
DRAWTEXTABS(25,125,'│'),Color00FFFF;<br />
DRAWTEXTABS(170,65,'│'),Color00FFFF;<br />
DRAWTEXTABS(170,77,'│'),Color00FFFF;<br />
DRAWTEXTABS(170,89,'│'),Color00FFFF;<br />
DRAWTEXTABS(170,101,'│'),Color00FFFF;<br />
DRAWTEXTABS(170,113,'│'),Color00FFFF;<br />
DRAWTEXTABS(170,125,'│'),Color00FFFF;<br />
DRAWTEXTABS(96,85,'│'),Color00FFFF;<br />
DRAWTEXTABS(96,89,'│'),Color00FFFF;<br />
DRAWTEXTABS(96,101,'│'),Color00FFFF;<br />
DRAWTEXTABS(96,113,'│'),Color00FFFF;<br />
DRAWTEXTABS(96,125,'│'),Color00FFFF;<br />
DRAWTEXTABS(30,60,'──────────'),Color00FFFF;<br />
DRAWTEXTABS(30,80,'──────────'),Color00FFFF;<br />
DRAWTEXTABS(30,97,'──────────'),Color00FFFF;<br />
DRAWTEXTABS(30,114,'──────────'),Color00FFFF;<br />
DRAWTEXTABS(30,131,'──────────'),Color00FFFF;<br />
G:=ZIG(3,5)&gt;REF(ZIG(3,5),1) AND REF(ZIG(3,5),1)&lt;=REF(ZIG(3,5),2) AND REF(ZIG(3,5),2)&lt;=REF(ZIG(3,5),3);<br />
X:=ZIG(3,5)&lt;REF(ZIG(3,5),1) AND REF(ZIG(3,5),1)&gt;=REF(ZIG(3,5),2) AND REF(ZIG(3,5),2)&gt;=REF(ZIG(3,5),3);<br />
ED:=barslast(G);<br />
EF:=barslast(X);<br />
DRAWTEXTREL(25,410,'买入:'+NUMTOSTR(ED) +'天'+'卖出:'+NUMTOSTR(EF) +'天'   ),colorFfff00;<br />
{K线优化}<br />
STICKLINE(close&gt;=open,open,close,8,1),colorred;<br />
STICKLINE(open&gt;close,close,open,8,0 ),ColorFFFF00;<br />
STICKLINE(close&gt;=open,close,HIGH,0.5 ,0 ),colorred;<br />
STICKLINE(close&gt;=open,open,low,0.5 ,0),colorred;<br />
STICKLINE(open&gt;close,close,low,0.5 ,0 ),ColorFFFF00;<br />
STICKLINE(open&gt;close,open,HIGH,0.5 ,0 ),ColorFFFF00;<br />
C2:=REF(C,1);<br />
涨停:=IF((C-C2)*100/C2&gt;=(10-0.01*100/C2),1,0);<br />
STICKLINE(涨停,OPEN,CLOSE,8,0),Color00FFFF;<br />
跌停:=IF((C2-C)*100/C2&gt;=(10-0.01*100/C2),1,0);<br />
STICKLINE(跌停,OPEN,CLOSE,8,0),ColorFF8000;<br />
{粉兰色K线};<br />
F:=100*(C-REF(C,1))/REF(C,1);<br />
今小昨:=IF(C&lt;REF(O,1) AND f&lt;0,1,0);<br />
p1:=今小昨;<br />
今小前:=IF(C&lt;REF(O,2) AND f&lt;0,1,0);<br />
p2:=今小前;<br />
stickline(P1=0 AND REF(P1,1)=1 AND P2=0 AND REF(P2,1)=1,open,CLOSE,6,0),COLORMAGENTA;<br />
stickline(P1=1 AND REF(P1,1)=0 AND P2=1AND REF(P2,1)=0,open,CLOSE,3,0),COLORBLUE;<br />
DRAWTEXT(G,L*0.997,'△'),ALIGN1,VALIGN0,Color00FF00;<br />
DRAWTEXT(G,L,' ̄'),ALIGN1,VALIGN0,Color00ff00;<br />
DRAWTEXT(X,H*1.002,'▽'),ALIGN1,VALIGN2,ColorFF00FF;<br />
DRAWTEXT(X,H,' ̄'),ALIGN1,VALIGN0,ColorFF00FF;<br />
DRAWTEXTREL(130,25,'所属板块:'+BKNAME),COLORFFFFFF;<br />
今市上涨家数:=INDEXADV;<br />
平盘家数:=DYNAINFO(68);<br />
今市下跌家数:=INDEXDEC;<br />
DRAWTEXTABS(30,10,'今市上涨:'+今市上涨家数+' 家'),ColorFFFF00,linethick2;<br />
DRAWTEXTABS(65,25,'平盘:'+平盘家数+' 家'),ColorFFFF00,linethick2;<br />
DRAWTEXTABS(65,40,'下跌:'+NUMTOSTRN(今市下跌家数,0)+' 家'),ColorFFFF00,linethick2;</p>
<p></p>
<p>&nbsp;</p>
页: [1]
查看完整版本: 主黄金线主图(大智慧)