input:n(3);
k1:=IF(CLOSE>=REF(CLOSE,1),HIGH-OPEN+CLOSE-LOW+CLOSE-REF(CLOSE,1),HIGH-OPEN+CLOSE-LOW);
k2:=IF(CLOSE<=REF(CLOSE,1),OPEN-LOW+HIGH-CLOSE+REF(CLOSE,1)-CLOSE,OPEN-LOW+HIGH-CLOSE);
dt:=VOL*K1/(K1+K2);
kt:=VOL-DT;
买量:sum(dt,n),COLOR0000FF;
卖量:-sum(kt,n),COLORFFFF00;
FILLRGN(买量,0,1,RGB(0,120,0));
FILLRGN(卖量,0,1,RGB(0,80,0));
进出量:买量+卖量,POINTDOT,COLOR00FFFF;
净量换手:100*进出量/CAPITAL,POINTDOT,COLOR00FF33;
STICKLINE(进出量>=0,0,进出量,6,1),COLOR0000FF;
STICKLINE(进出量<0,0,进出量,6,1),COLORFFFF00;
D3:=100*SUM(DT,6)/CAPITAL;
K3:=100*SUM(KT,6)/CAPITAL;
J3:=D3-K3;
D6:=100*SUM(DT,6)/CAPITAL;
K6:=100*SUM(KT,6)/CAPITAL;
J6:=D6-K6;
D9:=100*SUM(DT,20)/CAPITAL;
K9:=100*SUM(KT,20)/CAPITAL;
J9:=D9-K9;
BL3:=400/MAX(D3,K3);
BL6:=400/MAX(D6,K6);
BL9:=400/MAX(D9,K9);
DRAWRECTREL(0,0,360,999,RGB(50,50,50));
D3B:=999-D3*BL3;
K3B:=999-K3*BL3;
J3B:=999-ABS(J3)*BL3;
D6B:=999-D6*BL6;
K6B:=999-K6*BL6;
J6B:=999-ABS(J6)*BL6;
D9B:=999-D9*BL9;
K9B:=999-K9*BL9;
J9B:=999-ABS(J9)*BL9;
{画直方图}
DRAWRECTREL(30,D3B,50,999,RGB(150,0,0));
DRAWRECTREL(50,K3B,70,999,RGB(0,150,150));
DRAWRECTREL(70,J3B,90,999,RGB(150,150,0));
DRAWRECTREL(150,D6B,170,999,RGB(150,0,0));
DRAWRECTREL(170,K6B,190,999,RGB(0,150,150));
DRAWRECTREL(190,J6B,210,999,RGB(150,150,0));
DRAWRECTREL(270,D9B,290,999,RGB(150,0,0));
DRAWRECTREL(290,K9B,310,999,RGB(0,150,150));
DRAWRECTREL(310,J9B,330,999,RGB(150,150,0));
DRAWTEXTREL(90,0,'买量'), colorddffff;
DRAWTEXTREL(180,0,'卖量'), colorddffff;
DRAWTEXTREL(270,0,'进出量'), colorddffff;
DRAWTEXTREL(20,100,'今日'), color33ffff;
DRAWTEXTREL(90,100,NUMTOSTRN(100*DT/CAPITAL,2)), color33ffff;
DRAWTEXTREL(180,100,NUMTOSTRN(100*KT/CAPITAL,2)), color33ffff;
DRAWTEXTREL(270,100,NUMTOSTRN(100*DT/CAPITAL-100*KT/CAPITAL,2)), color33ffff;
DRAWTEXTREL(27,200,'3日'), colorddffff;
DRAWTEXTREL(90,200,NUMTOSTRN(D3,2)), colorddffff;
DRAWTEXTREL(180,200,NUMTOSTRN(K3,2)), colorddffff;
DRAWTEXTREL(270,200,NUMTOSTRN(J3,2)), colorddffff;
DRAWTEXTREL(20,300,'6日'), color33ffff;
DRAWTEXTREL(90,300,NUMTOSTRN(D6,2)), color33ffff;
DRAWTEXTREL(180,300,NUMTOSTRN(K6,2)), color33ffff;
DRAWTEXTREL(270,300,NUMTOSTRN(J6,2)), color33ffff;
DRAWTEXTREL(20,400,'9日'), colorddffff;
DRAWTEXTREL(90,400,NUMTOSTRN(D9,2)), colorddffff;
DRAWTEXTREL(180,400,NUMTOSTRN(K9,2)), colorddffff;
DRAWTEXTREL(270,400,NUMTOSTRN(J9,2)), colorddffff;
DRAWTEXTREL(15,800,'3'), colorbbffff;
DRAWTEXTREL(10,900,'日'), colorbbffff;
DRAWTEXTREL(130,800,'6'), colorbbffff;
DRAWTEXTREL(130,900,'日'), colorbbffff;
DRAWTEXTREL(250,800,'9'), colorbbffff;
DRAWTEXTREL(250,900,'日'), colorbbffff; |