箱體ABC...........................轉
n=2
cc:=c;
oo:=o;
hh:=h;
ll:=l;
top:=h;
bot:=l;
xx[1]:=1;
kk:=1;
for i=1 to datacount do begin if xx[i]=1 then begin top[i]:=hh[i];
end;
if xx[i-1]=1 then begin if hh[i]>top[i-1] then begin top[i]:=hh[i];
xx[i]:=1;
end;
else begin top[i]:=top[i-1];
xx[i]:=2;
end;
end;
if xx[i-1]=2 then begin if hh[i]>top[i-1] then begin top[i]:=hh[i];
xx[i]:=1;
end;
else begin top[i]:=top[i-1];
bot[i]:=ll[i];
xx[i]:=3;
end;
end;
if xx[i-1]=3 then begin top[i]:=top[i-1];
if ll[i]<bot[i-1] then begin bot[i]:=ll[i];
xx[i]:=3;
end;
else begin bot[i]:=bot[i-1];
xx[i]:=4;
end;
end;
if xx[i-1]=4 then begin top[i]:=top[i-1];
if ll[i]<bot[i-1] then begin bot[i]:=ll[i];
xx[i]:=3;
end;
else begin bot[i]:=bot[i-1];
xx[i]:=5;
end;
end;
if xx[i-1]=5 then begin if ll[i]<bot[i-1] or hh[i]>top[i-1] then begin top[i]:=hh[i];
bot[i]:=hh[i];
xx[i]:=1;
end;
else begin bot[i]:=bot[i-1];
top[i]:=top[i-1];
xx[i]:=5;
end;
end;
end;
for j=1 to datacount do begin if xx[j]=5 and xx[j-1]=4 then begin for k=j-1 downto j-kk do begin top[k]:=top[j];
bot[k]:=bot[j];
end;
end;
if xx[j-1]=5 and xx[j]=1 then kk:=0;
kk:=kk+1;
end;
中位線:=(top+bot)/2;
買點:=FILTER((TROUGHBARS(3,15,1)<4)=1,3);
賣點:=FILTER((PEAKBARS(3,15,1)<4)=1,3);
F:=100*(C-REF(C,1))/REF(C,1);
p1:=IF(C<REF(O,1) AND f<0,1,0);
p3:=IF(C>REF(O,1) AND f>0,1,0);
p2:=IF(C<REF(O,2) AND f<0,1,0);
p4:=IF(C>REF(O,2) AND f>0,1,0);
買D5:=P1=0 AND REF(P1,1)=1 AND P2=0 AND REF(P2,1)=1;
賣D6:=P3=0 AND REF(P3,1)=1 AND P4=0 AND REF(P4,1)=1;
FZ:=PEAK(3,5,1);
FW:=PEAKBARS(3,5,1);
GZ:=TROUGH(3,5,1);
GW:=TROUGHBARS(3,5,1);
AS:=ZIG(3,3);
漲AL:=CROSS(AS,REF(AS,1));
跌AG:=CROSS(REF(AS,1),AS);
Ss1:=IF(FW>GW,FW,0);
Ss2:=IF(FW<GW,GW,0);
Ss3:=BARSLAST(Ss1);
Ss4:=BARSLAST(Ss2);
PARTLINE(top=ref(top,1),top),Color008293;
PARTLINE(bot=ref(bot,1),bot),Color008293;
STICKLINE((top<>ref(top,1) or bot<>ref(bot,1)) and xx=1 and ref(xx,1)=5,top,bot,1,0),Color008293;
STICKLINE((top<>refx(top,1) or bot<>refx(bot,1)) and xx=5 and refx(xx,1)=1,top,bot,1,0),Color008293;
PARTLINE(top=ref(top,1),中位線),LINEDOT,Color008293;
STICKLINE(ma(c,5)>ma(c,10),CLOSE,OPEN,8,0),COLORred;
STICKLINE(ma(c,5)>ma(c,10),HIGH,LOW,0,0),COLORred;
STICKLINE(ma(c,10)>=ma(c,5),CLOSE,OPEN,8,0),COLORBLUE;
STICKLINE(ma(c,10)>=ma(c,5),HIGH,LOW,0,0),COLORBLUE;
HH:=HHV(HIGH,N);
LL:=LLV(LOW,N);
A1:=HH>REF(HH,2) && CLOSE>REF(CLOSE,2);
A2:=LL<REF(LL,2) && CLOSE<REF(CLOSE,2);
A3:=BARSLAST(A1);
A4:=BARSLAST(A2);
A5:=IF(A1,LL,REF(LL,A3));
A6:=IF(A2,HH,REF(HH,A4));
YZX:IF(A3>A4,A6,A5),LINETHICK2;
STICKLINE(CLOSE>YZX,CLOSE,OPEN,8,1),COLORRED,LINETHICK2;
STICKLINE(CLOSE<=YZX,CLOSE,OPEN,8,1),COLORBLUE,LINETHICK2;
|