Average True Range ATR Indicator For MT5
Table Of Contents:
- Average True Range ATR Indicator For MT5
- Instalace Average True Range ATR Indicator For MT5
- Parametry Average True Range ATR Indicator For MT5
- Vyrovnávací Average True Range ATR Indicator For MT5
- Hlavní části Kodexu
Average True Range ATR Indicator For MT5 je jedním z velmi slavných standardních ukazatelů téměř na každé obchodní platformě. Používá se jako základ pro mnoho dalších ukazatelů, které používají jeho hodnoty jako vstup pro další výpočet. Indikátor ATR počítá průměrnou velikost posledních X svíček. Tyto hodnoty vám umožní vidět rostoucí nebo klesající volatilitu na trhu.
Instalace Average True Range ATR Indicator For MT5
Po stažení indikátoru pomocí výše uvedeného formuláře je třeba rozbalit zip soubor. Pak musíte zkopírovat soubor atr.mq5 do složky MQL5Indicators vaší instalace MT5 . Poté prosím restartujte MT5 a poté uvidíte indikátor v seznamu indikátorů.
Parametry Average True Range ATR Indicator For MT5
Average True Range ATR Indicator For MT5 obsahuje parametry 1 lze nakonfigurovat.
input int InpAtrPeriod=14; // ATR period
Vyrovnávací Average True Range ATR Indicator For MT5
Average True Range ATR Indicator For MT5 2 Average True Range ATR Indicator For MT5 poskytuje vyrovnávací paměti 2 .
SetIndexBuffer(0,ExtATRBuffer,INDICATOR_DATA); SetIndexBuffer(1,ExtTRBuffer,INDICATOR_CALCULATIONS);
Hlavní části Kodexu
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); } //+------------------------------------------------------------------+