『壹』 1、幫助寫個通達信macd 的指標,與通達信自帶macd一樣。
1、簡單的,和系統macd一樣的如下:
DIF:EMA(CLOSE,12)-EMA(CLOSE,26),COLORBLUE;
DEA:EMA(DIF,9),COLORGREEN;
MACD:(DIF-DEA)*2,COLORSTICK;
紅柱:IF(MACD>REF(MACD,1),MACD,DRAWNULL),STICK,COLORRED;
綠柱:IF(MACD<REF(MACD,1),MACD,DRAWNULL),STICK,COLORGREEN;
2、 和系統macd參數一樣的,加了其他條件的如下:
DIF:EMA(CLOSE,12)-EMA(CLOSE,26),COLORBLUE;
DEA:EMA(DIF,9),COLORGREEN;
MACD:(DIF-DEA)*2,COLORSTICK;
紅柱:IF(MACD>REF(MACD,1),MACD,DRAWNULL),STICK,COLORRED;
綠柱:IF(MACD<REF(MACD,1),MACD,DRAWNULL),STICK,COLORGREEN;
抄底:ABS((CROSS(DIF,DEA)&&DEA<=-0.07)*DIF)*1.50,COLORLIMAGENTA;
強度1:IF(DIF>DEA,DIF,DRAWNULL),COLORRED,LINETHICK1;
強度2:IF(DEA<DIF,DEA,DRAWNULL),COLORMAGENTA,LINETHICK1;
DRAWTEXT(ABS(抄底)>0,抄底*1.10,'抄底'),COLORYELLOW;
DRAWICON(ABS(抄底)>0,抄底*1.02,4);
DRAWICON(CROSS(DIF,DEA),DEA,1);
DRAWICON(CROSS(DEA,DIF) ,DEA,2);
DRAWICON(CROSS(DIF,0) AND DIF>DEA,0,1);
DRAWICON(CROSS(0,DIF) AND DIF<DEA,0,2);
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
A2:=BARSLAST(REF(CROSS(DEA,DIF),1));
底背離:=REF(C,A1+1)>C AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA);
頂背離:=REF(C,A2+1)<C AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF);
DRAWTEXT(底背離=1 AND A2<=10,DIF,'底背'),COLORRED;
DRAWTEXT(頂背離=1 AND A1<=10,DIF,'頂背'),COLORGREEN;
XG:底背離=1 AND A2<=10,NODRAW;
『貳』 自動尋找底部龍抬頭指標公式
公式如下:
紅柱 :if(macd.macdref(macd.macd, 1),macd.macd,drawnull),stick,colorred; k t: :if(macd.macdref(macd.macd, 1),macd.macd,drawnull),stick,coloryellow;
抄底:abs((cross(macd.dif,macd.dea)
macd.dea=-0.07)*macd.dif)*1.50,colorlimagenta;dif:macd.dif,colorwhite;
dea:macd.dea,coloryellow;
強度 1:if(difdea,dif,drawnull),colorred,linethick2;
強度 2:if(deadif,dea,drawnull),colormagenta,linethick2;drawtext(abs(抄底 )0,抄底*1.20,抄底),coloryellow;drawicon(abs(抄底 )0,抄底*1.10,4);
drawicon(cross(dif,dea),dea,1);
drawicon(cross(dea,dif),dea,2);
var8:=vol2*ma(vol,30);
var9:=dmi. adx(10,6);
vara:=dmi.adxr(10,6);
varb:=closema(close,30) and closema(close,30)*1 .04;
varc:=ma(close,30)ref(ma(close,30),1);
vard:=barslast(cross(ma(close,5),ma(close, 10))barslast(cross(ma(close, 10),ma(close,5));
varf:=troughbars(3,15,1)4;
var10:=ema(close,30)ref(ema(close,30),2);var11:=if(varf=1 ,50,0);
多空 :ema((close-ma((2*close+high+low)/4,30))/ma((2*close+high+low)/4,30)*100,3),colorwhite;
O,colorred;
stickline(filter(varf=1 ,5) and
多空 -10,50,0,1 5,0),colorf00ffO;
stickline(filter(varf=1 ,5),50,0,6,0),coloryellow;
drawtext(filter(varf=1,3),25, .
大量買入),colorred ;
stickline( 33 -10,0, 3' ,0.85,0),coloryellow;stickline( g Z 10,0, 3Z ,0.95,0),colorred;
『叄』 求寫一個macd的選股公式
DIFF:= EMA(CLOSE,10) - EMA(CLOSE,30),colorwhite;
DEA: =EMA(DIFF,9),coloryellow;
MACD: =2*(DIFF-DEA), COLORSTICK;a:=(cross(diff*0.98,dea) or cross(diff,dea)) and dea>0.95; b:=vol>ref(vol,1) and ref(vol,1) >ref(vol,2) ;買:A AND B 粘貼後,可用
『肆』 求助:通達信MACD變色公式
_紅柱:IF("MACD.MACD">REF("MACD.MACD",1),"MACD.MACD",DRAWNULL),STICK,COLORRED;
綠柱:IF("MACD.MACD"<REF("MACD.MACD",1),"MACD.MACD",DRAWNULL),
STICK,COLORYELLOW;
_抄底:ABS((CROSS("MACD.DIF","MACD.DEA")
&&"MACD.DEA"<=-0.07)*"MACD.DIF")*1.50,COLORLIMAGENTA;
_DIF:"MACD.DIF",COLORWHITE;
_DEA:"MACD.DEA",COLORYELLOW;
__強度:IF(_DIF>_DEA,_DIF,DRAWNULL),COLORRED,LINETHICK2;
_強度:IF(_DEA<_DIF,_DEA,DRAWNULL),COLORMAGENTA,LINETHICK2;
DRAWTEXT(ABS(_抄底)>0,_抄底*1.20,' 抄底'),COLORYELLOW;
DRAWICON(ABS(_抄底)>0,_抄底*1.10,4);
DRAWICON(CROSS(_DIF,_DEA),_DEA,1);
DRAWICON(CROSS(_DEA,_DIF),_DEA,2);