Average True Range ATR Indicator For MT5

Average True Range ATR Indicator For MT5

Table Of Contents:

  1. Average True Range ATR Indicator For MT5
  2. Installere Average True Range ATR Indicator For MT5
  3. Parametere for Average True Range ATR Indicator For MT5
  4. Buffere av Average True Range ATR Indicator For MT5
  5. Hoveddeler av koden

Den Average True Range ATR Indicator For MT5 er en av de veldig berømte standardindikatorene i nesten alle handelsplattformer. Den brukes som grunnlag for mange andre indikatorer som bruker verdiene hans som input for videre beregning. ATR-indikatoren beregner gjennomsnittlig størrelse på de siste X-stearinlysene. Verdiene lar deg se en økning eller reduksjon av volatiliteten i markedet.

FREE Average True Range (ATR) Indicator

Download the FREE Average True Range (ATR) 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

 

Installere Average True Range ATR Indicator For MT5

Etter at du har lastet ned indikatoren via skjemaet over, må du pakke ut zip-filen. Deretter må du kopiere filen atr.mq5 til mappen MQL5Indicators for din MT5 installasjon. Etter det kan du starte MT5 på nytt, så vil du kunne se indikatoren i listen over indikatorer.

Parametere for Average True Range ATR Indicator For MT5

Average True Range ATR Indicator For MT5 har 1 parametere som skal konfigureres.

input int InpAtrPeriod=14;  // ATR period 

Buffere av Average True Range ATR Indicator For MT5

Average True Range ATR Indicator For MT5 inneholder 2 buffere.

SetIndexBuffer(0,ExtATRBuffer,INDICATOR_DATA); SetIndexBuffer(1,ExtTRBuffer,INDICATOR_CALCULATIONS); 

Hoveddeler av koden

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 &TickVolume[],                 const long &Volume[],                 const int &Spread[])   {    int i,limit; //--- check for bars count    if(rates_total lt =ExtPeriodATR)       return(0); // not enough bars for calculation //--- preliminary calculations    if(prev_calculated==0)      {       ExtTRBuffer[0]=0.0;       ExtATRBuffer[0]=0.0;       //--- filling out the array of True Range values for each period       for(i=1;i lt rates_total && !IsStopped();i++)          ExtTRBuffer[i]=MathMax(High[i],Close[i-1])-MathMin(Low[i],Close[i-1]);       //--- first AtrPeriod values of the indicator are not calculated       double firstValue=0.0;       for(i=1;i lt =ExtPeriodATR;i++)         {          ExtATRBuffer[i]=0.0;          firstValue+=ExtTRBuffer[i];         }       //--- calculating the first value of the indicator       firstValue/=ExtPeriodATR;       ExtATRBuffer[ExtPeriodATR]=firstValue;       limit=ExtPeriodATR+1;      }    else limit=prev_calculated-1; //--- the main loop of calculations    for(i=limit;i lt rates_total && !IsStopped();i++)      {       ExtTRBuffer[i]=MathMax(High[i],Close[i-1])-MathMin(Low[i],Close[i-1]);       ExtATRBuffer[i]=ExtATRBuffer[i-1]+(ExtTRBuffer[i]-ExtTRBuffer[i-ExtPeriodATR])/ExtPeriodATR;      } //--- return value of prev_calculated for next call    return(rates_total);   } //+------------------------------------------------------------------+ 

 

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.