这是【九九九九九九】的公式源码他的特点是一个均线图适合不同周期.设计不同的参数.以适应该周期的不同需求.
{指标名mac99}
hhv(h,last(CROSS(ma(c,75),ma(c,25))=0)+1),color999900;
llv(l,last(CROSS(ma(c,75),ma(c,25))=0)+1),color999900;
#define n(qq) if(BARSCOUNT( c)
5日:灰绿,,DOTLINE,color999900/5周线:灰白,DOTLINE,color999999/
1季线:锗黄加粗,DOTLINE,LINETHICK2,Color0080FF/1半年线:蓝色加粗,DOTLINE,LINETHICK2,Colorblue/1年线:暗红加粗,LINETHICK2,Color400080}
if DATATYPE>9 then begin
MA(CLOSE,n(5)),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(5)),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
MA(CLOSE,n(5)),DOTLINE,color999900;
MA(CLOSE,n(10)),DOTLINE,colorred;
MA(CLOSE,n(25)),DOTLINE,color999999;
MA(CLOSE,n(66)),DOTLINE,LINETHICK2,Color0080FF;
MA(CLOSE,n(132)),DOTLINE,LINETHICK2,Colorblue;
MA(CLOSE,n(264)),DOTLINE,LINETHICK2,Color400080;
end
if DATATYPE=7 then begin
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
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
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
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
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;