FOREX MT4 INDICATORS DOWNLOAD
  • Register
  • 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

DEMA.mq4

DEMA.mq4 FOREX MetaTrader4 Indicators Download
DEMA.mq4 FOREX MetaTrader4 Indicators Download

DEMA.mq4 download link will appear after 10 seconds.



Icon

DEMA.mq4

1 file(s) 1.85 KB
Download


DEMA.mq4 Programming source code

//+------------------------------------------------------------------+
//|                                                         DEMA.mq4 |
//| DEMA = 2 * EMA - EMA of EMA													|
//+------------------------------------------------------------------+
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1  Red
#property indicator_width1  1
//---- input parameters
extern int PERIOD  =14;
//---- indicator buffer
double Buffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   IndicatorShortName("DEMA("+PERIOD+")");
   SetIndexBuffer(0,Buffer);
   SetIndexStyle(0,DRAW_LINE);
  }
//+------------------------------------------------------------------+
int start()
  {
   int limit=Bars-1-IndicatorCounted();
//----
   static double lastEMA, lastEMA_of_EMA;
   double weight=2.0/(1.0+PERIOD);
   if(IndicatorCounted()==0)
     {
      Buffer[limit]  =Close[limit];
      lastEMA        =Close[limit];
      lastEMA_of_EMA  =Close[limit];
      limit--;
     }
//----
   //	Calculate old bars (not the latest), if necessary
   for(int i=limit; i > 0; i--)
     {
      lastEMA        =weight*Close[i]   + (1.0-weight)*lastEMA;
      lastEMA_of_EMA  =weight*lastEMA   + (1.0-weight)*lastEMA_of_EMA;
      Buffer[i]=2.0*lastEMA - lastEMA_of_EMA;
     }
//----
   //	(Re)calculate current bar
   double EMA        =weight*Close[0]   + (1.0-weight)*lastEMA,
   EMA_of_EMA  =weight*EMA      + (1.0-weight)*lastEMA_of_EMA;
   Buffer[0]=2.0*EMA - EMA_of_EMA;
//----
   return(0);
  }

//+------------------------------------------------------------------+

DED.ex4 DEMA_mod.mq4

Related Posts

METATRADER4D

Divergence Petr_HL_BB.mq4

METATRADER4D

Divergence Petr_HL.mq4

METATRADER4D

DEMA_RLH2.mq4

METATRADER4D

DEMA_mod.mq4

METATRADER4D

DED.ex4

METATRADER4D

DB Pivots Strategy.mq4

METATRADER4D

Daily open line.mq4

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