Author: FxPars
TrendEMA
Indicators Used
Moving average indicator
2 Views
0 Downloads
0 Favorites
TrendEMA
//+------------------------------------------------------------------+
//|                                                     TrendEMA.mq4 |
//|                                                           FxPars |
//|                                            http://www.fxpars.com |
//+------------------------------------------------------------------+
#property copyright "FxPars"
#property link      "http://www.fxpars.com"

#property indicator_chart_window
extern int LargeEMA=100;
extern int MediumEMA=10;
extern int LowEMA=5;
double Lma=0;
double Mma=0;
double Nma=0;
double pp=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- 
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
//---- 
   Lma=iMA(NULL,PERIOD_H1,LargeEMA,0,MODE_EMA,PRICE_CLOSE,1);
   Mma=iMA(NULL,PERIOD_H1,MediumEMA,0,MODE_EMA,PRICE_CLOSE,1);
   Nma=iMA(NULL,PERIOD_H1,LowEMA,0,MODE_EMA,PRICE_CLOSE,1);
   if (Lma>Mma && Mma>Nma) {
      Comment("DownTrend    " + "\nLargeEMA= " + Lma + "\nMediumEMA= " + Mma + "\nLowEMA= " + Nma);
     } else if (Lma<Mma && Mma<Nma) {
      Comment("UpTrend    " + "\nLargeEMA= " + Lma + "\nMediumEMA= " + Mma + "\nLowEMA= " + Nma); 
     } else {
     Comment("Sideway    " + "\nLargeEMA= " + Lma + "\nMediumEMA= " + Mma + "\nLowEMA= " + Nma);
     }
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---