《原创》大智慧L2-各周期均线自动切换源码(135均线为例)
DRAWTEXTABS(0,15,'__________________________________________________________________ '), coloryellow,LAYER0;
DRAWTEXTABS(0,-6,'__________________________________________________________________ '), coloryellow,LAYER0;
DRAWTEXTABS(-3,15,'|'), coloryellow;
DRAWTEXTABS(-3,5,'|'), coloryellow;
DRAWTEXTABS(393,15,'|'), coloryellow;
DRAWTEXTABS(393,5,'|'), coloryellow;{主图上用画矩形函数会产生压缩K线现象,所以用软键盘画制表符}
IF datatype=8 then begin
MA(C,13),colorred;
MA(C,34),colorgreen;
MA(C,55),colorblue;
{MA(C,89),DOTLINE;}
{MA(C,133),DOTLINE;}
DRAWTEXTABS(0,10,'◇日周期(13,34,55,89) '), colorwhite,LAYER0;
end
if datatype=7 then begin
MA(c,3),colorred;
MA(C,8),colorgreen;
MA(C,18),colorblue;
MA(C,220),DOTLINE;
{ma(c,52),DOTLINE;
ma(c,85),DOTLINE;
ma(c,18)-ref(ma(c,18),1),LINETHICK0;}
DRAWICON(TIME=103000,LOW,12),ALIGN1;
DRAWTEXTABS(0,10,'◇60周期(3,8,18,220) '), colorbbffff;
MA1:=MA(CLOSE,3);
MA2:=MA(CLOSE,8);
MA3:=MA(CLOSE,18);
TM:=V-MA(V,10);
穿三:=MA1>O AND MA2>O AND MA3>O AND MA1<C {AND MA2<C} AND MA3<C AND CLOSE>OPEN ;
DRAWTEXT(穿三,L-0.012,'穿三'),COLOR3399FF;
STICKLINE(穿三,OPEN,CLOSE,1,0),COLOR3399FF;
end
if datatype=6 or datatype=5 or datatype=4 or datatype=3 then begin
MA(c,3),colorred;
MA(C,8),colorgreen;
MA(C,18),colorblue;
MA(C,233),DOTLINE;
DRAWTEXTABS(0,10,'◇小周期(3,8,18,233) '), colorbbffff;
end;
if datatype=9 then begin
MA(c,5),colorred;
MA(C,13),colorgreen;
MA(C,21),colorblue;
MA(C,89),DOTLINE;
DRAWTEXTABS(0,10,'◇周线(5,13,21,89) '), colorbbffff;
end;
WW:=BARSLAST(DISPSTATUS=1);
低涨:(C/LLV(LOW,WW)-1)*100,LINETHICK0,colorred;
天:=BARSLAST(L=LLV(LOW,WW));
DRAWTEXTABS(140,10,'◇屏K线:'+NUMTOSTRN(WW+1,0)+'颗'),COLORYELLOW,LAYER0;
DRAWTEXTABS(225,10,'◇低点至今上涨:'+NUMTOSTRN(低涨,2)+'%'+NUMTOSTRN(天,0)+'颗'),COLORred,LAYER0;
{DRAWRECTREL(10,5,500,100,RGB(50,0,0)),coloryellow;}
高跌:(C/HHV(H,Ww)-1)*100,COLOR0000FF,LINETHICK0,PRECIS2;
天1:=BARSLAST(h=hhV(h,Ww));
{DRAWFLAGTEXT(1,c*1.1,'【最高】'+NUMTOSTRN(H,2)),COLORGREEN,LINETHICK1;
DRAWFLAGTEXT(1,c*1.1,'【最低】'+NUMTOSTRN(L,2)),COLORGREEN,LINETHICK1;
DRAWFLAGTEXT(1,c*1.1,'【收盘】'+NUMTOSTRN(C,2)),COLORGREEN,LINETHICK1;}
{M:1.02*HHVALL(H),colorblack;};
{DRAWRECTREL(00,950,320,1010,RGB(50,0,0)),coloryellow,LAYER0;}
DRAWTEXTREL(10,960,'◇差13='+NUMTOSTRN(ma(c,13)-ref(ma(c,13),1),3)),LINETHICK1,LAYER0;
DRAWTEXTREL(110,960,'◇差34='+NUMTOSTRN(ma(c,34)-ref(ma(c,34),1),3)),LINETHICK1,LAYER0;
DRAWTEXTREL(210,960,'◇差55='+NUMTOSTRN(ma(c,55)-ref(ma(c,55),1),3)),LINETHICK1,LAYER0,colorred;;
交易分钟数:=if(CURRENTTIME>93000 and CURRENTTIME<150000 and DYNAINFO(7)=CLOSE AND DYNAINFO(10)=AMOUNT,
if(CURRENTTIME<113000,(TIMETOT0(CURRENTTIME)-34200)/60,
if(CURRENTTIME>130000,(TIMETOT0(CURRENTTIME)-39600)/60,120)),240);
交易分时:=FRACPART( 交易分钟数/60);
剩余分时:=交易分时*60;
剩余秒:=FRACPART( 剩余分时);
剩余秒时:=剩余秒*60;
交易小时:=交易分钟数/60 ;
{显示文字}
DRAWTEXTABS(5,40,'交易时间:'+INTPART(交易小时)+'小时'+NUMTOSTRN(剩余分时,0)+'分'+NUMTOSTRN(剩余秒时,0)+'秒'),ColorF5FF00,LINETHICK1,PRECIS2,LAYER0;
|