需要修改一下指標參數計算。
//+------------------------------------------------------------------+
//| MACD_Billwin.mq4 |
//| Copyright ?2005, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2005, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Aqua
#property indicator_color2 Red
#property indicator_color3 Silver
//---- input parameters
extern int FastEMA=12;
extern int SlowEMA=26;
extern int SignalSMA=9;
//---- buffers
double ExtMapBuffer3[];
//---- indicator buffers
double ExtSilverBuffer[];
double ExtRedBuffer[];
double ExtAquaBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- drawing settings
SetIndexStyle(0,DRAW_LINE);
SetIndexStyle(1,DRAW_LINE);
SetIndexStyle(2,DRAW_HISTOGRAM);
SetIndexBuffer(2,ExtMapBuffer3);
//----
SetIndexDrawBegin(1,SignalSMA);
IndicatorDigits(5);
//---- indicator buffers mapping
SetIndexBuffer(0, ExtSilverBuffer);
SetIndexBuffer(1, ExtRedBuffer);
SetIndexBuffer(2, ExtAquaBuffer);
//---- name for DataWindow and indicator subwindow label
IndicatorShortName("BillWin_MACD("+FastEMA+","+SlowEMA+","+SignalSMA+")");
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| Moving Averages Convergence/Divergence |
//+------------------------------------------------------------------+
int start()
{
int limit;
int counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//---- macd counted in the 1-st buffer
for(int i=0; i<limit; i++)
ExtSilverBuffer=iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i);
//---- signal line counted in the 2-nd buffer
for(i=0; i<limit; i++)
ExtRedBuffer=iMAOnArray(ExtSilverBuffer,Bars,SignalSMA,0,MODE_SMA,i);
for(i=0; i<limit; i++)
ExtAquaBuffer=iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i) - iMAOnArray(ExtSilverBuffer,Bars,SignalSMA,0,MODE_SMA,i);
//---- done
return(0);
}
//+------------------------------------------------------------------+。
單線的金叉死叉就是那根單線和柱線的交叉,區別不大,而且MT4自帶的MACD其實表現力是更好的,估計你跟我一樣從股票或者期貨轉來炒匯的吧,所以開始不適應,適應適應就好了。
我以前也嘗試這找過,不過沒找到方法,這樣可以試試,你看已試試把均線指標拖拽的MACD的指標窗口,然后自己設置自己的均線交叉指標,拖拽兩根你想要的均線,參數改成你想要的交叉均線。
注意,“應用于”那里,均線指標設置的時候,要選擇應用到前一個指標參數(英文叫Previous Indicator‘s data),
然后隱藏MACD自帶的均線指標,把那根信號線參數改成1,這樣它貼著柱線就看不到了。
勉強算是雙線MACD指標了,手動修改版哈!
我還是建議你適應默認指標…
右擊鼠標,對macd指標曲線作設置。
這個需要編寫雙線的macd指標添加到mt4平臺里面去。原版的mt4平臺是單線macd指標。
將雙線的macd指標到mt4平臺里面之后,在技術指標里面調節出來,然后選定顏色之后確認就可以看到雙線的macd了。
MACD 是根據移動平均線的優點所發展出來的技術工具, 主要是利用長短期二條平滑平均線,計算兩者之間的差離值。該指標可以去除掉簡單移動平均線經常出現的假信號,又保留了移動平均線的優點。但由于 MACD 指標對價格變動的靈敏度不高,屬于中長線指標,因此在盤整行情中的使用效果較差。
MACD指標,KDJ指標,RSI指標,個人認為這三個指標都比較好用!
比較不錯的外匯黃金學習資料地址,
你看看里面是否有你需要的這個MT4操作資料