(function(){ var ua = navigator.userAgent.toLowerCase(); var bIsIpad = ua.match(/ipad/i) == "ipad"; var bIsIphoneOs = ua.match(/iphone os/i) == "iphone os"; var bIsAndroid = ua.match(/android/i) == "android"; var bIsWM=ua.match(/windows mobile/i)=="windows mobile"; var host = "https://m.juhaohua.cn"; var pathname = window.location.pathname; if(bIsIpad||bIsIphoneOs||bIsAndroid||bIsWM){ window.location.href =host + pathname; } })();

同花顺期货通MACD柱体变粗颜色代码分享

2024-09-25 19:57:22 期货 26次阅读 投稿:

同花顺期货通MACD柱体变粗颜色代码分享


MACD的柱体全是红色的话,非常不好分辨多空行情,也不好在高位及时离场。有时候柱体变短了也看不出来。


image.png

而改成如上图一样的,就非常明了,一旦绿柱出现,那么就代表有资金离场。 这就要关注行情变化了。可能要多转空,或者止盈离场了。


所以,MACD修改颜色还是非常有必要的,下面就分享上图AMCD的代码给大家使用:


BACKGROUNDSTYLE(2);
DIFF:EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:EMA(DIFF,9);
MACD:(DIFF-DEA)*2,COLORSTICK;
JC:=CROSS(DIFF,DEA);
SC:=CROSSDOWN(DIFF,DEA);
N1:=BARSLAST(JC) + 1;
N2:=BARSLAST(SC) + 1;
HH:=VALUEWHEN(CROSSDOWN(DIFF,DEA), HHV(H, N1));
HH2:=VALUEWHEN(CROSSDOWN(DIFF,DEA),REF(HH,1));
MHD:=VALUEWHEN(CROSSDOWN(DIFF,DEA),HHV(MACD,N1));
MHD2:=VALUEWHEN(CROSSDOWN(DIFF,DEA),REF(MHD,1));
LL:=VALUEWHEN(CROSS(DIFF,DEA), LLV(L, N2));
LL2:=VALUEWHEN(CROSS(DIFF,DEA),REF(LL,1));
MLD:=VALUEWHEN(CROSS(DIFF,DEA),LLV(MACD,N2));
MLD2:=VALUEWHEN(CROSS(DIFF,DEA),REF(MLD,1));
A:=CROSSDOWN(DIFF,DEA)&&HH>HH2&&MHD<MHD2;//顶背离
B:=CROSS(DIFF,DEA)&&LL<LL2&&MLD>MLD2;//底背离
DRAWTEXT(A, DIFF, '顶背离'),COLORGREEN;
DRAWTEXT(B, DIFF, '底背离'),COLORRED;
STICKLINE(MACD>=REF(MACD,1),MACD,0,6,0),COLOviridescence;
STICKLINE(MACD<REF(MACD,1),MACD,0,6,0),COLORGREEN;NOTEXTA:0,DOTLINE,COLORRED;

声明:聚财百科是理财投资基础知识平台! 并不指导专业性投资! 投资有风险,入市需谨慎!