Navigation:Home > Content >

Rads_SMAC-D_(1).mq4

Time: 2018-08-25 | Download file:Rads_SMAC-D_(1).mq4

//+------------------------------------------------------------------+
//|                                              9Squared SMAC-D.mq4 |
//|                                   Copyright © 2007, Steve Bowley |
//|                                        http://www.9squaredfx.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, Steve Bowley"
#property link      "http://www.9squaredfx.com"

#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 RoyalBlue
#property indicator_color2 Snow
#property indicator_color3 Snow
//---- input parameters
extern int       FastEMA=18;
extern int       SlowEMA=27;
extern int       SignalSMA=9;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
//---- indicator buffers
double ExtSilverBuffer[];
double ExtRedBuffer[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- additional buffers are used for counting
   IndicatorBuffers(5);
//---- drawing settings
   SetIndexStyle(0,DRAW_LINE,0,2);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexStyle(1,DRAW_LINE,0,1);
   SetIndexBuffer(1,ExtMapBuffer2);
   SetIndexStyle(2,DRAW_LINE,0,2);
   SetIndexBuffer(2,ExtMapBuffer3);
//----
   SetIndexDrawBegin(1,SignalSMA);
   IndicatorDigits(5);
//---- indicator buffers mapping
   SetIndexBuffer(0, ExtSilverBuffer);
   SetIndexBuffer(1, ExtRedBuffer);

//---- name for DataWindow and indicator subwindow label
   IndicatorShortName("SMAC-D");
//---- initialization done
   return(0);
  }
//+------------------------------------------------------------------+
//| 9Squared SMAC-D                                                  |
//+------------------------------------------------------------------+
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        

Recommend