Support-Resistance Indicator For MT5

Support-Resistance Indicator For MT5

Table Of Contents:

  1. Support-Resistance Indicator For MT5
  2. Installing the Support-Resistance Indicator For MT5
  3. Parameters of the Support-Resistance Indicator For MT5
  4. Buffers of the Support-Resistance Indicator For MT5
  5. Main Parts Of The Code

The Support-Resistance Indicator For MT5 draws dynamic support and resistance lines on the chart. The indicator use the Gaussian Transform algorithm to calculate the lines. You can define the distance of the support and resistance line by changing the parameter WindowSize.

FREE Support-Resistance Indicator Indicator

Download the FREE Support-Resistance 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

 

Installing the Support-Resistance 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 support-resistanceindicator.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 Support-Resistance Indicator For MT5

The Support-Resistance Indicator For MT5 has 2 parameters to configure.

input uint WindowSize=20; //window width input int Shift=0; // horizontal shift of the indicator in bars 

Buffers of the Support-Resistance Indicator For MT5

The Support-Resistance Indicator For MT5 provides 3 buffers.

SetIndexBuffer(0,ExtLineBuffer0,INDICATOR_DATA); SetIndexBuffer(1,ExtLineBuffer1,INDICATOR_DATA); SetIndexBuffer(2,ExtLineBuffer2,INDICATOR_DATA); 

Main Parts Of The Code

int OnCalculate(                 const int rates_total,    // amount of history in bars at the current tick                 const int prev_calculated,// amount of history in bars at the previous tick                 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[]                 )   { //---- Checking if the number of bars is sufficient for the calculation    if(rates_total lt min_rates_total) return(0);  //---- declaration of local variables     int limit,bar;    double Max,Min,slow,shigh;  //--- calculations of the necessary amount of data to be copied and //the limit starting index for loop of bars recalculation    if(prev_calculated gt rates_total || prev_calculated lt =0)// checking for the first start of the indicator calculation      {       limit=rates_total-min_rates_total-1; // starting index for calculation of all bars      }    else limit=rates_total-prev_calculated; // starting index for calculation of new bars  //---- indexing elements in arrays as time series      ArraySetAsSeries(high,true);    ArraySetAsSeries(low,true);    ArraySetAsSeries(open,true);    ArraySetAsSeries(close,true);  //---- main loop of the indicator calculation    for(bar=limit; bar gt =0 && !IsStopped(); bar--)      {       Max=0;       Min=999999999;              for(int kkk=bar; kkk lt int(bar+WindowSize); kkk++)         {          slow=Smooth_5(rates_total,PRICE_LOW,kkk,open,low,high,close);          if(slow lt Min) Min=slow;           shigh=Smooth_5(rates_total,PRICE_HIGH,kkk,open,low,high,close);          if(shigh gt Max) Max=shigh;         }                 ExtLineBuffer1[bar]=Max;       ExtLineBuffer0[bar]=(Max+Min)/2;       ExtLineBuffer2[bar]=Min;      } //----         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.