ATR Value Indicator For MT5

ATR Value Indicator For MT5

The ATR Value Indicator For MT5 displays the values of the ATR indicator on the chart. You can configure the period of the ATR. You can also define if the values should be displayed in pips or points. In addition you can define a multiplier like 200 percent to show multiples of the value of the ATR indicator.

FREE ATR Value Indicator Indicator

Download the FREE ATR Value Indicator Indicator for MT5.

To receive my email 100% sure: 
Put my email on your whitelist!

 

Partially Automated Trading Besides Your Day Job

Alerts In Real-Time When Divergences Occur

My Recommended MT4/MT5 Broker

 

Installing the ATR Value Indicator For MT5

After you downloaded the indicator via the form above you need to unzip the zip-file. Then you need to copy the file ATR Value Indicator.mq5 into the folder MQL5\Indicators of your MT5 installation. After that please restart MT5 and then you will be able to see the indicator in the list of indicators.

Parameters of the ATR Value Indicator For MT5

The ATR Value Indicator For MT5 has 11 parameters to configure.

input ENUM_Value_Type   InpDisplay        = 0;                                // Display Mode
input string            Desc1             = "========== ATR ==========";      // Description
input int               InpATRPeriod      = 14;                               // ATR Period
input ENUM_TIMEFRAMES   InpATRTimeframe   = PERIOD_CURRENT;                   // ATR Timeframe
input double            InpMultiplier     = 2.0;                              // Multiplier
input string            Desc2             = "========= Style =========";      // Description
input ENUM_CORNER       InpTextCorner     = RIGHT_UPPER;                      // Text Corner
input int               InpOffsetX        = 30;                               // Offset X
input int               InpOffsetY        = 30;                               // Offset Y
input color             InpTextColor      = clrRed;                           // Text Color
input int               InpTextFontSize   = 10;                               // Text Font Size

Buffers of the ATR Value Indicator For MT5

The ATR Value Indicator For MT5 provides 0 buffers.

Main Parts Of The Code

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
   DisplayATR();
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
void DisplayATR()
  {
   if(CopyBuffer(ATRHandle,0,0,2,ATRBuffer) lt =0)
     {
      Print("Getting ATR failed! Error",GetLastError());
      return;
     }
   double ATR=(ATRBuffer[0] *InpMultiplier)*MathPow(10,_Digits-InpDisplay);
   string Text=(string)(InpMultiplier*100)+"% of ATR ("+(string)InpATRPeriod+") : "+DoubleToString(ATR,0)+" "+EnumToString(InpDisplay);
   DrawLabel("ATR",Text);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void DrawLabel(string name,string text)
  {
   name = OBJPATTERN+name;
   int chart_ID=0;
   if(!ObjectCreate(chart_ID,name,OBJ_LABEL,0,0,0))
     {
      ObjectSetString(chart_ID,name,OBJPROP_TEXT,text);
      return;
     }
   ObjectSetInteger(chart_ID,name,OBJPROP_XDISTANCE,InpOffsetX);
   ObjectSetInteger(chart_ID,name,OBJPROP_YDISTANCE,InpOffsetY);
   ObjectSetInteger(chart_ID,name,OBJPROP_CORNER,TextCorner);
   ObjectSetString(chart_ID,name,OBJPROP_TEXT,text);
   ObjectSetString(chart_ID,name,OBJPROP_FONT,"Arial");
   ObjectSetInteger(chart_ID,name,OBJPROP_FONTSIZE,InpTextFontSize);
   ObjectSetDouble(chart_ID,name,OBJPROP_ANGLE,0);
   ObjectSetInteger(chart_ID,name,OBJPROP_ANCHOR,TextAnchor);
   ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,InpTextColor);
   ObjectSetInteger(chart_ID,name,OBJPROP_BACK,false);
   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,false);
   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,false);
   ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,true);
   ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void SetTextPosition()
  {
   if(InpTextCorner==LEFT_UPPER)
     {
      TextCorner=CORNER_LEFT_UPPER;
      TextAnchor=ANCHOR_LEFT_UPPER;
     }
   else if(InpTextCorner==LEFT_LOWER)
     {
      TextCorner=CORNER_LEFT_LOWER;
      TextAnchor=ANCHOR_LEFT_LOWER;
     }
   else if(InpTextCorner==RIGHT_UPPER)
     {
      TextCorner=CORNER_RIGHT_UPPER;
      TextAnchor=ANCHOR_RIGHT_UPPER;
     }
   else if(InpTextCorner==RIGHT_LOWER)
     {
      TextCorner=CORNER_RIGHT_LOWER;
      TextAnchor=ANCHOR_RIGHT_LOWER;
     }
  }
//+------------------------------------------------------------------+

 

About Me

I'm Mike Semlitsch the owner of PerfectTrendSystem.com. My trading career started in 2007. Since 2013 I have helped thousands of traders to take their trading to the next level. Many of them are now constantly profitable traders. 

The following performance was achieved by me while trading live in front of hundreds of my clients:

Connect With Me:  

Results From 5 Months!
This service starts soon! Be the first who get's notified when it begins!

This FREE Indicator Can Transform
Your Trading!

FREE Indicator + Telegram Group


Request the Ultimate Double Top/Bottom Indicator which is used by 10,000+ traders.