Phillip Nel's 4 hour MACD strategy indicator

Indicators coded by community members
Message
Author
plaforte
Posts: 11
Joined: Wed Aug 19, 2009 11:49 pm
Location: Singapore

Phillip Nel's 4 hour MACD strategy indicator

#1 Postby plaforte » Tue Dec 22, 2009 11:47 pm

Hi, has anybody programmed this indicator for FT ?

Thank you
Pierre

Feliks
Posts: 3
Joined: Wed Jun 16, 2010 4:06 am
Contact:

Re: Phillip Nel's 4 hour MACD strategy indicator

#2 Postby Feliks » Mon Jun 21, 2010 1:59 am

plaforte wrote:Hi, has anybody programmed this indicator for FT ?

Thank you
Pierre


Where you found this strategy there was the indicator you want
"Only God can judge us"

Everfree
Posts: 3
Joined: Tue Feb 19, 2013 11:16 am

#3 Postby Everfree » Fri Mar 01, 2013 7:34 pm

It's just a two color MACD histogram that shows when it is increasing or decreasing. The ForexTester MACD is fine except that the histogram is only one color so it is not as easy to see when the direction has changed.

Phillip Nel's 4H MACD Strategy is here: http://www.forexfactory.com/showthread.php?t=14630
Attachments
2_Color_MACD.png
2_Color_MACD.png (3.48 KiB) Viewed 14517 times

FT Support
Posts: 905
Joined: Sat Jul 11, 2009 10:54 am

#4 Postby FT Support » Mon Mar 04, 2013 12:56 pm

Can you post your indicator in MT4 format here? maybe someone will be able to convert it into Forex Tester format.
Check our other product here:
http://www.forexcopier.com

Everfree
Posts: 3
Joined: Tue Feb 19, 2013 11:16 am

#5 Postby Everfree » Mon Mar 04, 2013 10:31 pm

MACD_H4_300_v100_2 is a free indicator available on several forums. I compiled it with the colors I like but they can be easily changed.
To use in MT4, save the code as MACD_H4_300_v100_2.mq4

Code: Select all

//+------------------------------------------------------------------+
//|                                                  Custom MACD.mq4 |
//+------------------------------------------------------------------+
#property  copyright "Copyright © 2007, Igor Morozov"
#property  link      "http://www.herbspirit.com/mql"
//---- indicator settings
#property  indicator_separate_window
#property  indicator_buffers 3
#property  indicator_color1  LightSeaGreen
#property  indicator_color2  Magenta
#property  indicator_color3  Silver
#property  indicator_style3  STYLE_SOLID
#property  indicator_level1  0   
#property  indicator_levelcolor  Silver
#property  indicator_levelstyle  STYLE_SOLID
//---- indicator parameters
extern int FastEMA=5;
extern int SlowEMA=13;
extern int SignalSMA=1;
//---- indicator buffers
double     MacdBuffer[];
double     MacdBufferUp[];
double     MacdBufferDn[];
double     SignalBuffer[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- drawing settings
   SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexStyle(1,DRAW_HISTOGRAM);
   SetIndexStyle(2,DRAW_LINE);
   SetLevelValue(0,0);
   SetIndexDrawBegin(1,SignalSMA);
   IndicatorDigits(Point+1);
//---- indicator buffers mapping
   SetIndexBuffer(0,MacdBufferUp);
   SetIndexBuffer(1,MacdBufferDn);
   SetIndexBuffer(2,SignalBuffer);
//---- name for DataWindow and indicator subwindow label
   IndicatorShortName("MACD H4-300("+FastEMA+","+SlowEMA+","+SignalSMA+")");
   SetIndexLabel(0,"MACD UP");
   SetIndexLabel(1,"MACD DN");
   SetIndexLabel(2,"Signal");
//---- initialization done
   return(0);
  }
//+------------------------------------------------------------------+
//| Moving Averages Convergence/Divergence                           |
//+------------------------------------------------------------------+
int start()
  {
   int limit;
   int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
   int macdlimit=limit;
   if(macdlimit<Bars-5)
      macdlimit+=5;
   ArrayResize(MacdBuffer,macdlimit);
   ArraySetAsSeries(MacdBuffer,true);
//---- macd counted in the 1-st buffer
   for(int i=0; i<macdlimit; i++) {
      MacdBuffer[i]=(iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-
            iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i))/Point;
//      Print("MACDBUFFER=",MacdBuffer[i]);
   }
   for(i=0;i<limit;i++)
   {
      int j=i+1;
      while(MacdBuffer[i]==MacdBuffer[j]&&j-i<=5)
         j++;
      if(MacdBuffer[i]>MacdBuffer[j])
      {
         MacdBufferUp[i]=MacdBuffer[i];
         MacdBufferDn[i]=0;
      }
      else
      {
         MacdBufferDn[i]=MacdBuffer[i];
         MacdBufferUp[i]=0;
      }
   }
//---- signal line counted in the 2-nd buffer
   for(i=0; i<limit; i++)
      SignalBuffer[i]=iMAOnArray(MacdBuffer,Bars,SignalSMA,0,MODE_SMA,i);
//---- done
   return(0);
  }
//+------------------------------------------------------------------+

christoff
Posts: 46
Joined: Thu Nov 09, 2006 2:29 am

MACD Color

#6 Postby christoff » Wed Mar 20, 2013 1:47 am

I am quite sure I did something like that (with the help of someone in this forum).

Its name is something like MACD Color, can't remember.

Just search the forum, I am sure I posted it somewhere quite some time ago.

Enjoy

christoff
Posts: 46
Joined: Thu Nov 09, 2006 2:29 am

Correction

#7 Postby christoff » Wed Mar 20, 2013 2:00 am

Sorry,

My memory failed me. I think the credit has to go to dackjaniels, he created what i think you are looking for.

See the thread: "Custom MACD (based on Elder's impulse system)"

http://www.forextester.com/forum/viewto ... highlight=

Look towards the end of the thread, there you will find what you are looking for. The file is: "MACD_BD_Color Two tone plus EMA.zip"

Cheers


Return to “Indicators”

Who is online

Users browsing this forum: No registered users and 16 guests