當前位置:外匯行情大全網 - 外匯開戶 - 外匯金條是什麽意思?

外匯金條是什麽意思?

//+ - +

//| MACD_ColorHist_Alert.mq4 |

//|版權?2006年,羅伯特希爾|

//| |

//+ - +

#財產版權“版權?2006年,羅伯特·希爾

// -指示器設置

#屬性指示器_分隔_窗口

#屬性指示器_緩沖區4

#屬性指示器_color1淺綠色

#屬性指示器_顏色2紅色

#屬性指示器_顏色3綠色

#屬性指示器_顏色4紅色

// -指示器參數

extern bool SoundON = true

extern bool EmailON = false

extern int FastEMA = 12;

extern int SlowEMA = 26

extern int signals ma = 9;

// -指示器緩沖器

double ind _ buffer 1[];

double ind _ buffer 2[];

double histogram buffer up[];

double histogram buffer down[];

int flag val 1 = 0;

int flag val 2 = 0;

// -變量

//+ - +

//|自定義指示器初始化功能|

//+ - +

int init()

{

// -繪圖設置

//indicator buffers(3);

indicator DIGITS(market info(Symbol()、MODE _ DIGITS)+1);

SetIndexStyle(0,DRAW_LINE,STYLE _ SOLID);

SetIndexBuffer(0,ind _ buffer 1);

SetIndexDrawBegin(0,slow EMA);

SetIndexStyle(1,DRAW_LINE,STYLE _ DOT);

SetIndexBuffer(1,ind _ buffer 2);

SetIndexDrawBegin(1,signals ma);

SetIndexStyle(2,DRAW_HISTOGRAM,STYLE _ SOLID);

SetIndexBuffer(2,HistogramBufferUp);

SetIndexStyle(3,DRAW_HISTOGRAM,STYLE _ SOLID);

SetIndexBuffer(3,HistogramBufferDown);

// SetIndexDrawBegin(2,slow EMA+signals ma);

// -數據窗口和指示器子窗口標簽的名稱

indicator short name(" MACD("+FastEMA+","+SlowEMA+","+signals ma+");

SetIndexLabel(0,“MACD”);

SetIndexLabel(1,"信號");

SetIndexLabel(2,“直方圖”);

// -初始化完成

return(0);

}

//+ - +

//|移動平均線收斂/發散|

//+ - +

int start()

{

int限制;

雙溫;

int counted _ bars = indicator counted();

// -檢查可能的錯誤

if(counted _ bars & lt;0)返回(-1);

// -將重新計算最後計數的條形

if(counted _ bars & gt;0)counted _ bars-;

limit = Bars-counted _ Bars;

// - macd計入1-st緩沖區

for(int I = 0;我& lt極限;i++)

ind_buffer1[i]=iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,I);

// -第二緩沖區中計數的信號線

for(I = 0;我& lt極限;i++)

ind _ buffer 2[I]= iMAOnArray(ind _ buffer 1,Bars,SignalSMA,0,MODE_SMA,I);

//ind _ buffer 2[I]= alpha * ind _ buffer 1[I]+alpha _ 1 * ind _ buffer 2[I+1];

for(I = 0;我& lt極限;i++)

{

HistogramBufferUp[I]= 0;

HistogramBufferDown[I]= 0;

temp = ind _ buffer 1[I]-ind _ buffer 2[I];

if(temp & gt;= 0)

HistogramBufferUp[I]= temp;

其他

HistogramBufferDown[I]= temp;

if (i == 1)

{

if(HistogramBufferUp[I]& gt;0 & amp& amphistogram buffer down[I+1]& lt;0)

//if(HistogramBufferUp[I]& gt;HistogramBufferUp[i + 1])

{

//交叉起來

if (flagval1==0)

{

flag val 1 = 1;

flag val 2 = 0;

if (SoundON) Alert("MACD向上劃"," \n Time= ",TimeToStr(CurTime(),TIME_DATE)," ",TimeHour(CurTime()),":",TimeMinute(CurTime())," \n Symbol= ",Symbol()," Period= ",Period());

if (EmailON) SendMail("MACD向上穿越"," MACD向上穿越,Date="+TimeToStr(CurTime(),TIME _ Date)+" "+TIME hour(CurTime())+":"+TIME minute(CurTime())+" Symbol = "+Symbol()+" Period = "+Period());

}

}

else if(HistogramBufferDown[I]& lt;0 & amp& ampHistogramBufferUp[i + 1]>0)

//else if(HistogramBufferUp[I]& lt;HistogramBufferUp[i + 1])

{

//向下交叉

if (flagval2==0)

{

flag val 2 = 1;

flag val 1 = 0;

if (SoundON) Alert("MACD向下穿越"," \n Date= ",TimeToStr(CurTime(),TIME_DATE)," ",TimeHour(CurTime()),":",TimeMinute(CurTime())," \n Symbol= ",Symbol()," Period= ",Period());

if (EmailON) SendMail("MACD向下交叉"," MACD向下交叉",Date="+TimeToStr(CurTime(),TIME _ Date)+" "+TIME hour(CurTime())+":"+TIME minute(CurTime())+" Symbol = "+Symbol()+" Period = "+Period());

}

}

}

}

// -完成

return(0);

}

把上面的代碼復制到文檔中,比如名字叫macd2.mq4,後綴必須是mq4,然後放到mt4安裝目錄的experts\indicators中,重新打開mt4,在技術指標的定制中可以看到macd2。結束

  • 上一篇:惠州農村商業銀行股份有限公司澳頭支行的行號是多少?
  • 下一篇:外匯卷英語
  • copyright 2024外匯行情大全網