ihzx 发表于 2021-8-21 14:05:18

黄金分割+江恩八分线(大智慧)

<p>input:K(1,1,3);         <br />
DRAWGBKLAST(C&gt;0,STRIP(RGB(90,90,90),RGB(0,0,0),0));<br />
DRAWTEXTREL(0,3,'代码:'+STKLABEL),ColorFFFFFF;</p>
<p>T := BARSLAST(DISPSTATUS=1)+1;<br />
A := DISPSTATUS=2;<br />
HH := HHV(H, T);<br />
LL := LLV(L, T);<br />
HL := HH-LL;<br />
wH := HHVBARS(H, T);<br />
wL := LLVBARS(L, T);<br />
KK := wH-wL;<br />
mHL := HH-HL*0.5;<br />
if K=1 then begin<br />
HL191 := (HH-LL)*0.191;<br />
HL382 := (HH-LL)*0.382;<br />
HL618 := (HH-LL)*0.618;<br />
HL809 := (HH-LL)*0.809;<br />
if KK&lt;0 then begin<br />
a1 := HH-HL191;<br />
a2 := HH-HL382;<br />
a3 := HH-HL618;<br />
a4 := HH-HL809;<br />
end else begin<br />
a1 := LL+HL191;<br />
a2 := LL+HL382;<br />
a3 := LL+HL618;<br />
a4 := LL+HL809;<br />
end<br />
end<br />
if k=1 then begin<br />
HL125 := (HH-LL)*0.125;<br />
HL250 := (HH-LL)*0.25;<br />
HL375 := (HH-LL)*0.375;<br />
HL625 := (HH-LL)*0.625;<br />
HL750 := (HH-LL)*0.75;<br />
HL875 := (HH-LL)*0.875;<br />
if kk&lt;0 then begin<br />
b1 := HH-HL125;<br />
b2 := HH-HL250;<br />
b3 := HH-HL375;<br />
b4 := HH-HL625;<br />
b5 := HH-HL750;<br />
b6 := HH-HL875;<br />
end else begin<br />
b1 := LL+HL125;<br />
b2 := LL+HL250;<br />
b3 := LL+HL375;<br />
b4 := LL+HL625;<br />
b5 := LL+HL750;<br />
b6 := LL+HL875;<br />
end<br />
end<br />
DRAWTEXT(A and K&lt;&gt;3,HH, '最高价:'+HH),ALIGN2,colorgreen;<br />
DRAWTEXT(A and K&lt;&gt;3,LL, '最低价:'+ll),ALIGN2,VALIGN2,colorgreen;<br />
DRAWTEXT(A and K&lt;&gt;3,mHL,'50%:'+mHL),ALIGN2,color00ffff;<br />
DRAWTEXT(A and K=1, a1, '0.191:'+NUMTOSTRN(a1,2)),ALIGN2,color00ffff;<br />
DRAWTEXT(A and K=1, a2, '0.382:'+NUMTOSTRN(a2,2)),ALIGN2,color00ffff;<br />
DRAWTEXT(A and K=1, a3, '0.618:'+NUMTOSTRN(a3,2)),ALIGN2,color00ffff;<br />
DRAWTEXT(A and K=1, a4, '0.809:'+NUMTOSTRN(a4,2)),ALIGN2,color00ffff;<br />
DRAWTEXT(A and K=1, b1, '1/8:'+NUMTOSTRN(b1,2)),ALIGN2,colorgreen;<br />
DRAWTEXT(A and K=1, b2, '1/4:'+NUMTOSTRN(b2,2)),ALIGN2,colorgreen;<br />
DRAWTEXT(A and K=1, b3, ' 3/8:'+NUMTOSTRN(b3,2)),ALIGN0,colorgreen;<br />
DRAWTEXT(A and K=1, b4, ' 5/8:'+NUMTOSTRN(b4,2)),ALIGN0,colorgreen;<br />
DRAWTEXT(A and K=1, b5, '3/4:'+NUMTOSTRN(b5,2)),ALIGN2,colorgreen;<br />
DRAWTEXT(A and K=1, b6, '7/8:'+NUMTOSTRN(b6,2)),ALIGN2,colorgreen;<br />
DRAWTEXT(A and K&lt;&gt;3,HH, ' ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄'),ALIGN2,colorred,linethick7;<br />
DRAWTEXT(A and K&lt;&gt;3,LL, ' ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄'),ALIGN2,colorred,linethick7;<br />
DRAWTEXT(A and K&lt;&gt;3,mHL,' ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄'),ALIGN2,colorff0000,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;</p>
<p>DRAWTEXT(A and K=1, b1, '﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉'),ALIGN2,color00FF00;<br />
DRAWTEXT(A and K=1, b2, '﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉'),ALIGN2,color00ff00;<br />
DRAWTEXT(A and K=1, b3, '﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉'),ALIGN2,color00ff00;<br />
DRAWTEXT(A and K=1, b4, '﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉'),ALIGN2,color00ff00;<br />
DRAWTEXT(A and K=1, b5, '﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉'),ALIGN2,color00ff00;<br />
DRAWTEXT(A and K=1, b6, '﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉'),ALIGN2,color00FF00;</p>
<p>PT:= REF(HIGH,1)-REF(LOW,1);<br />
重心:=(HIGH + LOW + CLOSE)/3;<br />
压力Ⅰ:= 2*重心-LOW;<br />
压力Ⅱ:= 重心 + PT;<br />
支撑Ⅰ:= 2*重心-HIGH;<br />
支撑Ⅱ:= 重心 - PT;<br />
DRAWTEXTABS(75,8,'《逆势操作》'),ColorFFFF00;<br />
DRAWTEXTABS(150,8,'重心:'+重心),Color208FFF;<br />
DRAWTEXTABS(75,27,'    支撑'),ColorFFFFFF;<br />
DRAWTEXTABS(75,44,'    '+支撑Ⅰ),ColorFFFFFF;<br />
DRAWTEXTABS(75,62,'    '+支撑Ⅱ),ColorFFFFFF;<br />
DRAWTEXTABS(75,27,'                压力'),Color00FF00;<br />
DRAWTEXTABS(75,44,'                '+压力Ⅰ),Color00FF00;<br />
DRAWTEXTABS(75,62,'                '+压力Ⅱ),Color00FF00;<br />
DRAWTEXTABS(75,5,'│'),Color00FFFF;<br />
DRAWTEXTABS(75,17,'│'),Color00FFFF;<br />
DRAWTEXTABS(75,29,'│'),Color00FFFF;<br />
DRAWTEXTABS(75,41,'│'),Color00FFFF;<br />
DRAWTEXTABS(75,53,'│'),Color00FFFF;<br />
DRAWTEXTABS(75,65,'│'),Color00FFFF;<br />
DRAWTEXTABS(218,5,'│'),Color00FFFF;<br />
DRAWTEXTABS(218,17,'│'),Color00FFFF;<br />
DRAWTEXTABS(218,29,'│'),Color00FFFF;<br />
DRAWTEXTABS(218,41,'│'),Color00FFFF;<br />
DRAWTEXTABS(218,53,'│'),Color00FFFF;<br />
DRAWTEXTABS(218,65,'│'),Color00FFFF;<br />
DRAWTEXTABS(146,25,'│'),Color00FFFF;<br />
DRAWTEXTABS(146,29,'│'),Color00FFFF;<br />
DRAWTEXTABS(146,41,'│'),Color00FFFF;<br />
DRAWTEXTABS(146,53,'│'),Color00FFFF;<br />
DRAWTEXTABS(146,65,'│'),Color00FFFF;<br />
DRAWTEXTABS(80,0,'────────────'),Color00FFFF;<br />
DRAWTEXTABS(80,20,'────────────'),Color00FFFF;<br />
DRAWTEXTABS(80,37,'────────────'),Color00FFFF;<br />
DRAWTEXTABS(80,54,'────────────'),Color00FFFF;<br />
DRAWTEXTABS(80,71,'────────────'),Color00FFFF;</p>
<p>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 />
买入到卖出天数:ED,LINETHICK0,ColorFFFFFF;<br />
卖出到买入天数:EF,LINETHICK0,ColorFFFFFF;<br />
换手: VOL/CAPITAL*100,LINETHICK0,colorwhite;<br />
DRAWTEXTREL(0,910,'             买入到到当前周期:'+NUMTOSTR(ED) +'天'+'   卖出到当前周期:'+NUMTOSTR(EF) +'天'+' 换手率:'+NUMTOSTRN(换手,2) +'%'),colorFfff00;</p>
<p></p>
<p>&nbsp;</p>
页: [1]
查看完整版本: 黄金分割+江恩八分线(大智慧)