FOREX MT4 INDICATORS DOWNLOAD
  • Donate to us
  • MT4 INDICATORS A
  • MT4 INDICATORS B
  • MT4 INDICATORS C
  • MT4 INDICATORS D
  • MT4 INDICATORS E
  • MT4 INDICATORS F
  • MT4 INDICATORS G
  • MT4 INDICATORS H
  • MT4 INDICATORS I
  • MT4 INDICATORS J
  • MT4 INDICATORS K
  • MT4 INDICATORS L
  • MT4 INDICATORS M
  • MT4 INDICATORS N
  • MT4 INDICATORS O
  • MT4 INDICATORS P
  • MT4 INDICATORS Q
  • MT4 INDICATORS R
  • MT4 INDICATORS S
  • MT4 INDICATORS T
  • MT4 INDICATORS U
  • MT4 INDICATORS V
  • MT4 INDICATORS W
  • MT4 INDICATORS X
  • MT4 INDICATORS Y
  • MT4 INDICATORS Z
  • MT4 INDICATORS NUM
  • MT4 INDICATORS SIGN

eMacd.mq4

eMacd.mq4 FOREX MetaTrader4 Indicators Download

eMacd.mq4 download link will appear after 20 seconds.


Icon

eMacd.mq4

1 file(s) 3.56 KB
Download


eMacd.mq4 Programming source code.

#property indicator_separate_window
#property indicator_buffers 4
#property indicator_color1 Blue
#property indicator_color2 Red
#property indicator_color3 Red
#property indicator_color4 Blue

//---- input parameters
extern int       FastMAPeriod=12;
extern int       SlowMAPeriod=26;
extern int       SignalMAPeriod=9;

//---- buffers
double MACDLineBuffer[];
double SignalLineBuffer[];
double HistogramBuffer[];
double MACDHistoBuffer[];

//---- variables
double alpha = 0;
double alpha_1 = 0;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
{
   IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+1);
   //---- indicators
   SetIndexStyle(0,DRAW_HISTOGRAM, STYLE_SOLID,1);
   SetIndexBuffer(0,MACDHistoBuffer);
   SetIndexDrawBegin(0,SlowMAPeriod);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,SignalLineBuffer);
   SetIndexDrawBegin(1,SlowMAPeriod+SignalMAPeriod);
   SetIndexStyle(2,DRAW_HISTOGRAM);
   SetIndexBuffer(2,HistogramBuffer);
   SetIndexDrawBegin(2,SlowMAPeriod+SignalMAPeriod);
   SetIndexStyle(3,DRAW_LINE, STYLE_SOLID,1);
   SetIndexBuffer(3,MACDLineBuffer);
   SetIndexDrawBegin(3,SlowMAPeriod);
   //---- name for DataWindow and indicator subwindow label
   IndicatorShortName("MACD("+FastMAPeriod+","+SlowMAPeriod+","+SignalMAPeriod+")");
   SetIndexLabel(0,"MACD");
   SetIndexLabel(1,"Signal");
   //----
	alpha = 2.0 / (SignalMAPeriod + 1.0);
	alpha_1 = 1.0 - alpha;
   //----
   return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
{
   //---- 
   
   //----
   return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
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;

   for(int i=limit; i>=0; i--)
   {
      MACDLineBuffer[i] = iMA(NULL,0,FastMAPeriod,0,MODE_EMA,PRICE_CLOSE,i) - iMA(NULL,0,SlowMAPeriod,0,MODE_EMA,PRICE_CLOSE,i);
      SignalLineBuffer[i] = alpha*MACDLineBuffer[i] + alpha_1*SignalLineBuffer[i+1];
      HistogramBuffer[i] = MACDLineBuffer[i] - SignalLineBuffer[i];
      MACDHistoBuffer[i] = iMA(NULL,0,FastMAPeriod,0,MODE_EMA,PRICE_CLOSE,i) - iMA(NULL,0,SlowMAPeriod,0,MODE_EMA,PRICE_CLOSE,i);
   }
   
   //----
   return(0);
}
//+------------------------------------------------------------------+
EMA_Cross_RSI_Trend_Spotter_Edit.mq4 envelopes_of_stochastic.mq4

Related Posts

METATRADER4E

envelopes_of_stochastic.mq4

METATRADER4E

EMA_Cross_RSI_Trend_Spotter_Edit.mq4

METATRADER4E

ELR color.mq4

METATRADER4E

Elliot oscillator – waves 1.03_NRP.mq4

METATRADER4E

Ehlers Fisher transform 2.4 mtf.mq4

METATRADER4E

EATA pollan vers mod 2_2 (mq4).mq4

METATRADER4E

EATA _Alert2.mq4

METATRADER4E

EasyTrendVisualizer.ex4

How to use this site.
  1. Subscribe YouTube
  2. Subscribe Facebook
  3. Subscribe Instagram
  4. Download MT4
  5. Watch Youtube Video
  6. Downliad Indicator and Try Trading
  7. Donate to us for update

Recent News

  • i-g-cci2.mq4
  • haosvisual_27jk8.mq4
  • HamaSystem separate window.ex4
  • HalfTrend 2.mq4
  • Gitalovsa.mq4

Donate