|
引用: 最初由 P7181 發表
總版主您好:
感謝您,也感謝其他狐友的幫助。
我想要再請總版主幫一個忙,有沒有辦法在下列的公式原碼中,讓DIFF和DEA這兩條線不要被colorstick遮在後面呢?
我要拜託總版主幫我把這兩條線放到前面來,感激不盡。
{Moving Average Convergence/Divergence , MACD , 移動平均收斂/發散指標}
PartLine(CLOSE>0,0),COLORCYAN,LINETHICK2;
DIFF:EMA(CLOSE,SHORT) - EMA(CLOSE,LONG),coloryellow,linethick2;
DEA:=EMA(DIFF,M);
MACD:2*(DIFF-DEA),colorstick,linethick1;
DRAWICON(DIFF>ref(DIFF,1) and ref(DIFF,1)<=ref(DIFF,2),DIFF,4) pxdn4;
DRAWICON(DIFF<ref(DIFF,1) and ref(DIFF,1)>=ref(DIFF,2),DIFF,5) pxup18;
DRAWICON(DIFF>ref(DIFF,1) and islastbar,DIFF,4) pxdn4;
DRAWICON(DIFF<ref(DIFF,1) and islastbar,DIFF,5) pxup18;
STICKLINE(MACD>0,0,MACD,2,0) colorred,Linethick4;
STICKLINE(sum(MACD>0,2)=2 and MACD>ref(MACD,1),0,MACD,2,0) colorbrown,Linethick4;
STICKLINE(sum(MACD>0,2)=2 and MACD<ref(MACD,1),0,MACD,2,0) color9900FF,Linethick4;
STICKLINE(MACD<0,0,MACD,2,0) colorgreen,Linethick5;
STICKLINE(sum(MACD<0,2)=2 and MACD<ref(MACD,1),0,MACD,2,0) colorwhite,Linethick4;
STICKLINE(sum(MACD<0,2)=2 and MACD>ref(MACD,1),0,MACD,2,0) colorFF9900,Linethick4;
PartLine(CLOSE>0,0),COLORCYAN,LINETHICK2;
DIFF:EMA(CLOSE,SHORT) - EMA(CLOSE,LONG),coloryellow,linethick0;
DEA:EMA(DIFF,M) colorFFFFFF linethick0;
MACD:2*(DIFF-DEA),colorstick,linethick1;
DRAWICON(DIFF>ref(DIFF,1) and ref(DIFF,1)<=ref(DIFF,2),DIFF,4) pxdn4;
DRAWICON(DIFF<ref(DIFF,1) and ref(DIFF,1)>=ref(DIFF,2),DIFF,5) pxup18;
DRAWICON(DIFF>ref(DIFF,1) and islastbar,DIFF,4) pxdn4;
DRAWICON(DIFF<ref(DIFF,1) and islastbar,DIFF,5) pxup18;
STICKLINE(MACD>0,0,MACD,2,0) colorred,Linethick4;
STICKLINE(sum(MACD>0,2)=2 and MACD>ref(MACD,1),0,MACD,2,0) colorbrown,Linethick4;
STICKLINE(sum(MACD>0,2)=2 and MACD<ref(MACD,1),0,MACD,2,0) color9900FF,Linethick4;
STICKLINE(MACD<0,0,MACD,2,0) colorgreen,Linethick5;
STICKLINE(sum(MACD<0,2)=2 and MACD<ref(MACD,1),0,MACD,2,0) colorwhite,Linethick4;
STICKLINE(sum(MACD<0,2)=2 and MACD>ref(MACD,1),0,MACD,2,0) colorFF9900,Linethick4;
PARTLINE(1,DIFF),coloryellow,linethick2;
PARTLINE(1,DEA),colorFFFFFF;
|