箱体王 主图源码
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,8,0),COLORAA;
STICKLINE(CLOSE<OPEN,CLOSE,OPEN,8,0),COLOR998855;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,5,0),COLORCC;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,3,0),COLORDD;
STICKLINE(CLOSE>OPEN,HIGH,LOW,0,0),COLORFF;
STICKLINE(CLOSE<OPEN,CLOSE,OPEN,5,0),COLORBBAA77;
STICKLINE(CLOSE<OPEN,CLOSE,OPEN,3,0),COLORDDCC99;
STICKLINE(CLOSE<OPEN,HIGH,LOW,0,0),COLORFFEEBB;
FH:=HIGH;
FL:=LOW;
SELL:=0*FH;
BUY:=SELL;
SIGNAL:=SELL;
BOXH:SELL,LINETHICK0;
BOXL:SELL,LINETHICK0;
VARIABLE:HC=0,LC=0,BT=FH[1],BB=FH[1];
FOR I=1 TO DATACOUNT DO BEGIN
IF HC>1 THEN BEGIN
IF LC>2 AND BT<=FH THEN BEGIN
BUY:=1;
FOR J=I-1 DOWNTO I-HC DO BEGIN
BOXH[J]:=FH[I-HC],LINETHICK0;
BOXL[J]:=FL[I-LC],LINETHICK0;
END;
HC:=0;
LC:=0;
END;
IF BT>FH THEN BEGIN
IF LC>2 THEN BEGIN
IF BB>=FL THEN BEGIN
SELL:=1;
FOR J=I-1 DOWNTO I-HC DO BEGIN
BOXH[J]:=FH[I-HC],LINETHICK0;
BOXL[J]:=FL[I-LC],LINETHICK0;
END;
HC:=-1;
LC:=0;
END;ELSE BEGIN
BOXH:=FH[I-HC],LINETHICK0;
BOXL:=FL[I-LC],LINETHICK0;
END;
END;
HC:=HC+1;
IF LC>1 THEN BEGIN
IF BB<FL THEN BEGIN
LC:=LC+1;
IF LC=3 THEN BEGIN
SIGNAL[I-HC+1]:=1;
FOR J=I DOWNTO I-HC+1 DO BEGIN
BOXH[J]:=FH[I-HC+1],LINETHICK0;
BOXL[J]:=FL[I-LC+1],LINETHICK0;
END;
END;
END;ELSE
LC:=0;
END;ELSE
IF LC=1 THEN BEGIN
IF BB<FL THEN BEGIN
LC:=LC+1;
END;ELSE
LC:=0;
END;
IF LC=0 AND HC>1 THEN BEGIN
BB:=FL;
LC:=LC+1;
END;
END;ELSE BEGIN
HC:=0;
LC:=0;
END;
END;ELSE
IF HC=1 THEN BEGIN
IF BT>FH THEN
HC:=HC+1;ELSE BEGIN
HC:=0;
LC:=0;
END;
END;
IF HC=0 THEN BEGIN
BT:=FH;
HC:=HC+1;
END;
END;
PARTLINE(BOXH AND BOXH=REF(BOXH,1),BOXH),LINEDOT,COLORFFFF;
PARTLINE(BOXL AND BOXL=REF(BOXL,1),BOXL),LINEDOT,COLORFFFF;
STICKLINE((SIGNAL OR REFX(BUY OR SELL,1)) AND BOXH,BOXH,BOXL,0.1,0),LINEDOT,COLORFFFF;
DRAWICON(BUY,LOW*0.98,4);
DRAWICON(SELL,HIGH*1.02,5);
A1:=BOXH AND BOXH=REF(BOXH,1);
A2:=REFX(REF(A1=0,1) AND A1=1,1);
A3:=REFX(REF(A1=1,1) AND A1=0,1);
DRAWLINE(A2,BOXL,A3,BOXH,0),COLORFF9900;
DRAWLINE(A2,BOXH,A3,BOXL,0),COLORFF00;
PARTLINE(BOXH AND BOXH=REF(BOXH,1),(BOXH-BOXL)/2+BOXL),COLORFF9900;
STICKLINE((SIGNAL OR REFX(BUY OR SELL,1)) AND BOXH,BOXH,BOXL,0.1,0),LINEDOT,COLORFFFF;
ZZ:=BACKSET(REFX(BUY OR SELL,1),BARSLAST(SIGNAL)/2);
ZX:=REFX(REF(ZZ=0,1) AND ZZ=1,1);
DRAWLINE(SIGNAL,BOXH,ZX,BOXL,0),LINEDOT,COLORFF00;
DRAWLINE(SIGNAL,BOXH,REFX(BUY OR SELL,1),(BOXH-BOXL)/2+BOXL,0),LINEDOT,COLORFF00;
DRAWLINE(SIGNAL,BOXL,ZX,BOXH,0),LINEDOT,COLORFF9900;
DRAWLINE(SIGNAL,BOXL,REFX(BUY OR SELL,1),(BOXH-BOXL)/2+BOXL,0),LINEDOT,COLORFF9900;
DRAWLINE(SIGNAL,BOXH,ISLASTBAR AND BOXH>BOXL,BOXL,0),COLORFF00;
DRAWLINE(SIGNAL,BOXH,ISLASTBAR AND BOXH>BOXL,(BOXH-BOXL)/2+BOXL,0),LINEDOT,COLORFF00;
DRAWLINE(SIGNAL,BOXL,ISLASTBAR AND BOXH>BOXL,BOXH,0),COLORFF9900;
DRAWLINE(SIGNAL,BOXL,ISLASTBAR AND BOXH>BOXL,(BOXH-BOXL)/2+BOXL,0),LINEDOT,COLORFF9900;
ZA:=BACKSET(ISLASTBAR AND BOXH>BOXL,BARSLAST(SIGNAL)/2);
ZB:=REFX(REF(ZA=0,1) AND ZA=1,1);
DRAWLINE(SIGNAL,BOXH,ZB,BOXL,0),LINEDOT,COLORFF00;
DRAWLINE(SIGNAL,BOXL,ZB,BOXH,0),LINEDOT,COLORFF9900;
|