{1.K线}
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,8.5,0) ,COLOR000011;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,7,0) ,COLOR000033;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,6,0) ,COLOR000055;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,5,0) ,COLOR000077;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,4,0) ,COLOR000099;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,3,0) ,COLOR0000BB;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,2,0) ,COLOR0000DD;
STICKLINE((CLOSE >= OPEN),HIGH,LOW,0.5,0),color0000FF;
STICKLINE((OPEN >= CLOSE),CLOSE,OPEN,8.5,0),color006600;
STICKLINE((OPEN >= CLOSE),CLOSE,OPEN,7,0),color008800;
STICKLINE((OPEN >= CLOSE),CLOSE,OPEN,6,0),color00AA00;
STICKLINE((OPEN >= CLOSE),CLOSE,OPEN,5,0),color00BB00;
STICKLINE((OPEN >= CLOSE),CLOSE,OPEN,4,0),color00CC00;
STICKLINE((OPEN >= CLOSE),CLOSE,OPEN,3,0),color00DD00;
STICKLINE((OPEN >= CLOSE),CLOSE,OPEN,2,0),color00EE00;
STICKLINE((OPEN > CLOSE),HIGH,LOW,0.5,0),color00FF00;
AH1:hhv(h,last(CROSS(ma(c,90),ma(c,30))=0)+1),color0077FF;
AL2:llv(l,last(CROSS(ma(c,90),ma(c,30))=0)+1),colorFF9900;
下跌:LAST(AH1>H),PRECIS0 ,LINETHICK0;
DRAWTEXT(barstatus=2 AND 下跌,AH1,'----【N:='+NUMTOSTRN(下跌,0)+'】---- '),ALIGN2,Color00FFff,linethick3,LAYER0;
X:=BARSLAST(DISPSTATUS=1)+1;
P:=BACKSET(DISPSTATUS=2,X/2+1);
K:=BARSLAST(CROSS(P,0.5))+1;
K0:(0.5*AH1+0.5*AL2),COLOR00ffff,DOTLINE;
K1:IF(K>=0,(0.618*AH1+0.382*AL2),0),COLOR0077ff,DOTLINE;
K2:IF(K>=0,AL2+(AH1-AL2)*0.74,0),COLOR00FFff,DOTLINE;
K3:IF(K>=0,AL2+(AH1-AL2)*0.865,0),COLOR0000ff,DOTLINE;
K5:IF(K>=0,(0.382*AH1+0.618*AL2),0),COLOR0598ff,DOTLINE;
K6:IF(K>=0,AH1-(AH1-AL2)*0.74,0),DOTLINE;
K7:IF(K>=0,AH1-(AH1-AL2)*0.865,0),COLOR99ff99,DOTLINE;
nnl:=DISPSTATUS=2;
DRAWTEXT(nnl,AH1*0.998,'最高--→'+AH1+'元'),ALIGN1,Color0047FF,LINETHICK1;
DRAWTEXT(nnl,K3,'0.865-→'+NUMTOSTRN(K3,2)+'元'),ALIGN1,Color0047FF,LINETHICK1;
DRAWTEXT(nnl,K2,'0.742-→'+NUMTOSTRN(K2,2)+'元'),ALIGN1,Color00FFff,LINETHICK1;
DRAWTEXT(nnl,K1,'0.618-→'+NUMTOSTRN(K1,2)+'元'),ALIGN1,Color0047FF,LINETHICK1;
DRAWTEXT(nnl,K0,'0.500-→'+NUMTOSTRN(K0,2)+'元'),ALIGN1,Color00FF00,LINETHICK1;
DRAWTEXT(nnl,K5,'0.382-→'+NUMTOSTRN(K5,2)+'元'),ALIGN1,Color00FFff,LINETHICK1;
DRAWTEXT(nnl,K6,'0.258-→'+NUMTOSTRN(K6,2)+'元'),ALIGN1,Color0047FF,LINETHICK1;
DRAWTEXT(nnl,K7,'0.135-→'+NUMTOSTRN(K7,2)+'元'),ALIGN1,Color99FF99,LINETHICK1;
DRAWTEXT(nnl,AL2*1,'最低--→'+AL2+'元'),ALIGN1,VALIGN2,Color0047FF,LINETHICK1;
HK1:=AL2+(AH1-AL2)*0.742;
HK2:=AL2+(AH1-AL2)*0.5;
HK3:=AL2+(AH1-AL2)*0.258;
FILLRGN(AH1,HK1,AH1>HK1,RGB(90,0,90)),LAYER7;
FILLRGN(HK1,HK2,HK1>HK2,RGB(0,0,90)),LAYER7;
FILLRGN(HK2,HK3,HK2>HK3,RGB(0,90,0)),LAYER7;
FILLRGN(HK3,AL2,HK3>AL2,RGB(0,45,0)),LAYER7;
#define N(MAC99) if(BARSCOUNT(C)<MAC99,0,MAC99)
if DATATYPE>10 then begin {月}
MA(CLOSE,n(6)),DOTLINE,color999999;
MA(CLOSE,n(12)),DOTLINE,LINETHICK2,Color0080FF;
MA(CLOSE,n(24)),DOTLINE,LINETHICK2,Colorblue;
MA(CLOSE,n(48)),DOTLINE,LINETHICK2,Color400080;
end
if DATATYPE=9 then begin {周}
MA(CLOSE,n(4)),DOTLINE,color999999;
MA(CLOSE,n(12)),DOTLINE,LINETHICK2,Color0080FF;
MA(CLOSE,n(24)),DOTLINE,LINETHICK2,Colorblue;
MA(CLOSE,n(48)),DOTLINE,LINETHICK2,Color400080;
end
if DATATYPE=8 then begin {日}
M5:MA(CLOSE,n(5)),color0000FF;
M13:MA(CLOSE,n(13)),color0077FF;
M21:MA(CLOSE,n(21)),color999999;
M55:MA(CLOSE,n(55)),LINETHICK2,Color0080FF;
M89:MA(CLOSE,n(89)),LINETHICK2,Colorblue;
M121:MA(CLOSE,n(121)),LINETHICK2,Color400080;
end
if DATATYPE=7 then begin {60分}
MA(CLOSE,n(5)),DOTLINE,colorgreen;
MA(CLOSE,n(10)),DOTLINE,colorred;
MA(CLOSE,n(20)),DOTLINE,color999900;
MA(CLOSE,n(100)),DOTLINE,color999999;
end
if DATATYPE=6 then begin {30分}
MA(CLOSE,n(5)),DOTLINE,colorff00ff;
MA(CLOSE,n(10)),DOTLINE,colorgreen;
MA(CLOSE,n(60)),DOTLINE,color999900;
MA(CLOSE,n(300)),DOTLINE,color999999;
end
if DATATYPE=5 then begin {15分}
MA(CLOSE,n(5)),DOTLINE,color00ffff;
MA(CLOSE,n(10)),DOTLINE,colorff00ff;
MA(CLOSE,n(20)),DOTLINE,colorgreen;
MA(CLOSE,n(100)),DOTLINE,color999900;
end
if DATATYPE=4 then begin {5分}
MA(CLOSE,n(5)),DOTLINE,colorwhite;
MA(CLOSE,n(15)),DOTLINE,color00ffff;
MA(CLOSE,n(30)),DOTLINE,colorff00ff;
MA(CLOSE,n(60)),DOTLINE,colorgreen;
end
if DATATYPE=3 or DATATYPE=1 then begin {分时 OR 1分}
ma25n1:MA(CLOSE,n(25)),DOTLINE,colorwhite;
ma75n1:MA(CLOSE,n(75)),DOTLINE,color00ffff;
ma150n1:MA(CLOSE,n(150)),DOTLINE,colorff00ff;
ma300n1:MA(CLOSE,n(300)),DOTLINE,colorgreen;
end
if DATATYPE=2 then begin {分笔};
ma100f:MA(CLOSE,n(100)),DOTLINE,colorwhite;
ma200f:MA(CLOSE,n(200)),DOTLINE,color00ffff;
ma500f:MA(CLOSE,n(500)),DOTLINE,colorff00ff;
ma1000f:MA(CLOSE,n(1000)),DOTLINE,colorgreen;
end;