Reversal Indicator For MT5
Table Of Contents:
- Reversal Indicator For MT5
- Installing the Reversal Indicator For MT5
- Parameters of the Reversal Indicator For MT5
- Buffers of the Reversal Indicator For MT5
- Main Parts Of The Code
The Reversal Indicator For MT5 shows a special type of reversal. The developer of the indicator looks at a range. If the actual candle produces a new low within the range but then closes as a bullish candle then you should enter long on the next candle.
Installing the Reversal 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 Reversal.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 Reversal Indicator For MT5
The Reversal Indicator For MT5 has 2 parameters to configure.
input int Interval=10; input bool Send_Email=true;
Buffers of the Reversal Indicator For MT5
The Reversal Indicator For MT5 provides 2 buffers.
SetIndexBuffer(0,Buffer1); SetIndexBuffer(1,Buffer2);
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[]) { int limit=rates_total-prev_calculated; //--- counting from 0 to rates_total ArraySetAsSeries(Buffer1,true); ArraySetAsSeries(Buffer2,true); //--- initial zero if(prev_calculated lt 1) { ArrayInitialize(Buffer1,0); ArrayInitialize(Buffer2,0); } else limit++; datetime Time[]; if(CopyHigh(Symbol(), PERIOD_H6, 0, rates_total, High) lt = 0) return(rates_total); ArraySetAsSeries(High,true); if(CopyClose(Symbol(), PERIOD_H6, 0, rates_total, Close) lt = 0) return(rates_total); ArraySetAsSeries(Close,true); if(CopyOpen(Symbol(), PERIOD_H6, 0, rates_total, Open) lt = 0) return(rates_total); ArraySetAsSeries(Open,true); if(CopyLow(Symbol(), PERIOD_H6, 0, rates_total, Low) lt = 0) return(rates_total); ArraySetAsSeries(Low,true); if(CopyTime(Symbol(), Period(), 0, rates_total, Time) lt = 0) return(rates_total); ArraySetAsSeries(Time,true); //--- main loop for(int i=limit-1; i gt =0; i--) { if(i gt =MathMin(5000-1,rates_total-1-50)) continue; //omit some old rates to prevent "Array out of range" or slow calculation //Indicator Buffer 1 if(High[1+i]==Resistance(Interval*PeriodSeconds(),false,00,00,false,i) //Candlestick High is equal to Resistance && Close[1+i] lt Open[1+i]//Candlestick Close lt Candlestick Open ) { Buffer1[i]=High[i]; //Set indicator value at Candlestick High if(i==1 && Time[1]!=time_alert) myAlert("indicator","Sell"); //Alert on next bar open time_alert=Time[1]; } else { Buffer1[i]=0; } //Indicator Buffer 2 if(Low[1+i]==Support(Interval*PeriodSeconds(),false,00,00,false,i) //Candlestick Low is equal to Support && Close[1+i] gt Open[1+i]//Candlestick Close gt Candlestick Open ) { Buffer2[i]=Low[i]; //Set indicator value at Candlestick Low if(i==1 && Time[1]!=time_alert) myAlert("indicator","Buy"); //Alert on next bar open time_alert=Time[1]; } else { Buffer2[i]=0; } } return(rates_total); } //+------------------------------------------------------------------+