求助MACD頂底背離公式!謝謝大蝦

2021-03-12 14:39:06 字數 5499 閱讀 4886

1樓:白雲飄飄刀炕母

第一個公式《通達信》

diff:= ema(close,12) - ema(close,26);

dif:ema(close,12) - ema(close,26),colorred;

dea:ema(dif,9),colorblue;

macd:2*(dif-dea),colorstick;

fh1:=ref(macd,1)=0 and count(macd>ref(macd,1),1)=1;

fh3:=fh1 and fh2 and ema(c,13)>ref(ema(c,13),1);

fh4:=fh1 and fh2 and abs((dif-dea)/c)<0.018;

fh5:=fh1 and fh2 and macd<0.10;

vv:=close>open and ma(close,5)>ma(close,10) and ma(close,10)>ma(close,30)

and diff>dea and macd>ref(macd,1) and diff>0 and dea>0 and

ma(vol,5)>ma(vol,34) and ma(close,30)>=ref(ma(close,30),1);

佛手:if(vv,1,0),nodraw;

drawicon(佛手,0.06,11);

二次翻紅:(fh3 or fh4 or fh5),colorred,nodraw;

低買:cross(dif,dea) and dif<0,colorff00ff,nodraw;

加油:cross(dif,dea) and dif>0,coloryellow,nodraw;

drawicon(二次翻紅,-0.05,1);

drawtext(二次翻紅,-0.15,'↖翻紅'),colorred;

drawtext(cross(dif,dea) and dif<0,dea-0.02,'↖低買'),colorff00ff;

drawtext(cross(dif,dea) and dif>0,dea-0.05,'↖加油'),coloryellow;

xg:二次翻紅 or 低買 or 加油,nodraw;

ylzc:=if(close=indexc,(indexc+indexh+indexl+indexo)/4,amount/(vol+0.01)/100);

阻價:=if(close=indexc,ylzc+indexc-indexl,ylzc+(close-low));

支價:=if(close=indexc,indexl+indexc-ylzc,low+(close-ylzc));

今壓:ref(阻價,1),li***hick0,coloraa11bb,nodraw;

今撐:ref(支價,1),li***hick0,color009900,nodraw;

明壓:阻價,li***hick0,nodraw;

明撐:支價,li***hick0,nodraw;

第二個公式《通達信》

sqx:=(c-ma(close,13))*100;

dif:ema(ma(sqx,7),1),li***hick1;

dea:ema(dif,7),li***hick1;

macd: (dif-dea)*2,colorstick;

紅柱持股:if(macd>ref(macd,1),macd,drawnull),stick,colorred,li***hick1;

綠柱持幣:if(macd=0));

二次金叉:if(cross(dif,dea) and dea<0 and count(jccount=2,21)=1,0.2,0),colorff00ff,pointdot;

stickline(二次金叉,25,15,8,1),colorff00ff;

a1:=barslast(ref(cross(dif,dea),1));

底背離:if(ref(close,a1+1)>close and dif>ref(dif,a1+1) and cross(dif,dea),0.1,0),colorred,pointdot;

stickline(底背離,40,30,8,1),colorred;

drawline(a1=0,dea,底背離,dea,0),colorred;

a2:=barslast(ref(cross(dea,dif),1));

頂背離:ref(close,a2+1)dif and cross(dea,dif),col***reen;

drawline(a2=0,dea,頂背離,dea,0),col***reen;

a3:=cross(dif,dea) and dea<0;

零下二次金叉:if(filter(count(a3,21)=2,10),0.05,0),colorwhite,pointdot;

stickline(零下二次金叉,45,55,8,1),colorwhite;

金叉:drawicon(cross(dif,dea),dif,1);

死叉:drawicon(cross(dea,dif),dif,2);

第三個公式 金牌macd《通達信》

diff:ema(close,12)-ema(close,27);

dea:ema(diff,9);

macd:=2*(diff-dea);

stickline(macd>=0,macd,0,2,1),colorf00ff0;

stickline(macd<0,macd,0,2,1),colorwhite;

stickline(macd0,0,macd,2,0 ),color00aaff;

stickline(macd0,0,macd,2,0 ),color00bbff;

stickline(macd0,0,macd,2,0 ),color00ccff;

stickline(macd0,0,macd,2,0 ),color00ddff;

stickline(macd0,0,macd,2,0 ),color00eeff;

stickline(macd0,0,macd,2,0 ),color00ffff;

stickline(macd>=ref(macd,1)and macd>0,0,macd,2,0 ),color0000aa;

stickline(macd>=ref(macd,1)and macd>0,0,macd,2,0 ),color0011bb;

stickline(macd>=ref(macd,1)and macd>0,0,macd,2,0 ),color0022cc;

stickline(macd>=ref(macd,1)and macd>0,0,macd,2,0 ),color0033dd;

stickline(macd>=ref(macd,1)and macd>0,0,macd,2,0 ),color0044ee;

stickline(macd>=ref(macd,1)and macd>0,0,macd,2,0 ),color0055ff;

stickline(macd>ref(macd,1)and macd<0,0,macd,2,0 ),coloraa00bb;

stickline(macd>ref(macd,1)and macd<0,0,macd,2,0 ),colorbb11bb;

stickline(macd>ref(macd,1)and macd<0,0,macd,2,0 ),colorcc22bb;

stickline(macd>ref(macd,1)and macd<0,0,macd,2,0 ),colordd33bb;

stickline(macd>ref(macd,1)and macd<0,0,macd,2,0 ),coloree44bb;

stickline(macd>ref(macd,1)and macd<0,0,macd,2,0 ),colorff55bb;

stickline(macd<=ref(macd,1)and macd<0,0,macd,2,0 ),colorffaa00;

stickline(macd<=ref(macd,1)and macd<0,0,macd,2,0 ),colorffbb11;

stickline(macd<=ref(macd,1)and macd<0,0,macd,2,0 ),colorffcc22;

stickline(macd<=ref(macd,1)and macd<0,0,macd,2,0 ),colorffdd33;

stickline(macd<=ref(macd,1)and macd<0,0,macd,2,0 ),colorffee44;

stickline(macd<=ref(macd,1)and macd<0,0,macd,2,0 ),colorffff55;

if(diff<0,diff,0),colorred,li***hick1;

if(diff<0,0,diff),coloryellow,li***hick1;

if(diffdea,dea,dea),colorwhite,li***hick1;

低位金叉:=cross(diff,dea) and diff<-0.1;

stickline(低位金叉,0,-0.18,2,0),coloryellow;

drawtext(低位金叉,-0.1,' 低位金叉'),coloryellow;

jccount:=count(cross(diff,dea),barslast(dea>=0));

二次金叉:=cross(diff,dea) and dea<0 and count(jccount=2,21)=1;

stickline(二次金叉,0,-0.18,2,0),colorff00ff;

drawicon(二次金叉,dea*1.04,13) ;

drawtext(二次金叉,-0.1,' 二次金叉'),colorff00ff;

a1:=barslast(ref(cross(diff,dea),1));

底背離:=ref(close,a1+1)>close and diff>ref(diff,a1+1) and cross(diff,dea);

stickline(底背離,0,0.13,2,0),color00ff00;

drawline(a1=0,dea,底背離,dea,0),colorred,li***hick2;

drawtext(底背離,0.1,' 底背離'),color00ff00;

a2:=barslast(ref(cross(dea,diff),1));

頂背離:=ref(close,a2+1)diff and cross(dea,diff);

drawline(a2=0,dea,頂背離,dea,0),col***reen,li***hick2;

第四個選股公式《通達信》

diff:=ema(close,12)-ema(close,26);

dea:=ema(diff,9);

macd:=2*(diff-dea);

jccount:=count(cross(diff,dea),barslast(dea>=0));

二次金叉:cross(diff,dea) and dea<0 and count(jccount=2,21)=1;

macd計算公式MACD計算公式

dif和macd在0以上,大勢屬多頭市場。dif向上突破macd時,可作買 若dif向 破macd時,只可作原單的平倉,不可新賣單進場。dif和macd在0以下,大勢屬空頭市場。dif向 破macd時,可作賣 若dif向上突破macd時,只可作原單的平倉,不可新買單進場。高檔二次向下交叉大跌,低檔二...

MACD指標怎麼用,MACD指標怎麼調?

1.當dif和dea處於0軸以上時,屬於多頭市場,dif線自下而上穿越dea線時是 訊號。dif線自上而下穿越dea線時,如果兩線值還處於0軸以上執行,僅僅只能視為一次短暫的回落,而不能確定趨勢轉折,此時是否賣出還需要藉助其他指標來綜合判斷。2.當dif和dea處於0軸以下時,屬於空頭市場。dif線...

macd紅綠柱代表什麼,macd的紅綠柱是什麼意思

慢速線在快速線下面就是紅柱,反之綠柱。柱高表示力度。macd的紅綠柱是什麼意思 macd紅柱代表什麼,綠柱體表什麼 macd紅柱代表dif減dea的值大於0,這時dif在dea之上代表多頭 macd綠柱代表dif值減dea小於0,這時dif在dea之下代表空頭 紅柱線的增長減短表示 買盤力量的增減 ...