//DRAWGBK(1,COLORRGB(240,240,240),COLORRGB(240,240,240),0);
{--------------------均线组----------------}
{18日收盘均价为安全生命线}
EMA(close,18),COLOR006600,LINETHICK4;
安全生命线:EMA(close,18),COLOR00CC00,LINETHICK2;
MA1:ema(close,3),COLORRED,LINETHICK2;
MA2:ema(close,5),color009900;
MA3:ema(close,8),color00aa00;
MA4:ema(close,10),COLOR00bb00;
MA5:ema(close,12),COLOR00CC00;
MA6:ema(close,15),COLOR00DD00;
MA7:ema(close,30),COLOR990099;
MA8:ema(close,35),COLORAA00AA;
MA9:ema(close,40),COLORBB00BB;
MA10:ema(close,45),COLORCC00CC;
MA11:ema(close,50),COLORDD00DD;
MA12:ema(close,60),COLOREE00EE;
eMA(close,3),COLORYELLOW,LINETHICK1;
{-------顾比倒数------------}
ff:=l;
fhf:=h;
fgf:=h;
ftf:=l;
fdf:=l;
zdtf:=c;
zqf:=c;
zqtf:=c;
{顾比倒数进场}
<%
f=ffl.vardata("ff")
fh=ffl.vardata("fhf")
fg=ffl.vardata("fgf")
ft=ffl.vardata("ftf")
fd=ffl.vardata("fdf")
zq=ffl.vardata("zqf")
zqt=ffl.vardata("zqtf")
zdt=ffl.vardata("zdtf")
zq(1)=0
zq(2)=0
zqt(1)=0
zqt(2)=0
tj=0
n=ubound(f)
for i=2 to n
k1=0
k2=0
k3=0
ii=i-2
for j=ii to 2 step -1
if f(j)<f(j-1) and f(j)<f(j-2) and f(j)<f(j+1) and f(j)<f(j+2) then
k1=j
exit for
end if
next
j=k1-1
while j>=0 and tj=0
if fh(j)>fh(k1) then
k2=j
tj=1
else
j=j-1
end if
wend
j=k2-1
tj=0
while j>=0 and tj=0
if fh(j)>fh(k2) then
k3=j
tj=1
else
j=j-1
end if
wend
if k3>0 then
fg(i)=fh(k3)
zq(i)=k3
else
fg(i)=fg(i-1)
zq(i)=zq(i-1)+1
end if
next
ffl.vardata("fgf")=fg
ffl.vardata("zqf")=zq
'止损线'
for i=2 to n
k1=0
k2=0
k3=0
ii=i-2
for j=ii to 2 step -1
if fh(j)>fh(j-1) and fh(j)>fh(j-2) and fh(j)>fh(j+1) and fh(j)>fh(j+2) then
k1=j
exit for
end if
next
tj=0
j=k1-1
while j>=0 and tj=0
if fh(j)<fh(k1) then
k2=j
tj=1
else
j=j-1
end if
wend
if k2>0 then
fd(i)=fh(k2)
zdt(i)=k2
else
fd(i)=fd(i-1)
zdt(i)=zdt(i-1)+1
end if
j=k2-1
tj=0
while j>0 and tj=0
if fh(j)<fh(k2) then
k3=j
tj=1
else
j=j-1
end if
wend
if k3>0 then
ft(i)=fh(k3)
zqt(i)=k3
else
ft(i)=ft(i-1)
zq(i)=zqt(i-1)+1
end if
next
ffl.vardata("ftf")=ft
ffl.vardata("fdf")=fd
ffl.vardata("zqtf")=zqt
ffl.vardata("zdtf")=zdt
%>
离场线:ftf,linethick1,COLORWHITE,LINEDOT;//如果想把止损位提高,可选第二根k线做参考线,把ftf改成fdf就可以了;
顾比倒数:fgf,COLOR0066FF,LINEDOT;
{-----------------------------立体K线--------------------------------------}
KC:=close;
KO:=ref(close,1);
STICKLINE(ko<kc,HIGH,LOW,0.5,0 ),COLOR0000CC;
STICKLINE(ko>=kc,LOW,HIGH,0.5 ,0 ),COLOR999900;
STICKLINE(ko>=kc ,CLOSE ,OPEN,7,0 ),COLOR665500;
STICKLINE(ko>=kc ,CLOSE ,OPEN,5,0 ),COLOR999900;
STICKLINE(ko<kc,CLOSE,OPEN,7,0 ),COLOR000066;
STICKLINE(ko<kc,CLOSE,OPEN,5,0 ),COLOR0000CC;
{-----------买卖点----------------------}
Eee:=IF(cross(c,ma4) and cross(c,安全生命线),1,0);
短3:=EMA(CLOSE,3);
长30:=EMA(CLOSE,30) ,COLORRED;
K60:=EMA(CLOSE,60) ,COLORGREEN;
VV:=CROSS(短3,K60) AND K60>REF(K60,1);
VV1:=CROSS(短3,长30) AND 长30>REF(长30,1);
XG2:=IF(VV,1,0);
XG1:=IF(VV1,1,0);
转势:=(XG2 OR XG1);
DRAWTEXT(转势 and Eee and CROSS(CLOSE,顾比倒数),LOW*0.95,'趋势买'),COLORMAGENTA;
DRAWTEXT(转势,LOW*0.92,'搏短'),colorred;
//DRAWTEXT(cross(c,ma2) and cross(c,ma4),LOW*0.92,'短买'),colorred;
//DRAWTEXT(cross(离场线,c),H*1.05,'离场'),colorred;