90% Accurate Indicator! "Super Signal" For MT5 (Little Modification NEEDED)

mrrich06

Master Trader
Nov 3, 2013
30
15
74
My Hello to all the Members of this Forum and Upcoming Forex Traders,
I came across a forex indicator which was BB Arrow Signal, which was one of the best indicator that produces 90% accurate signals for any Currency Pairs. I thought to give it a try but unfortunately it was just available for MT4 not for MT5. Bad luck for me because my Broker runs on MT5 platform only. So, I thought of to create my own indicator but I couldn't code because I'm not a Programmer. To solve this problem I researched hard and hard enough and found out that the indicator was renamed later and it was a Clone of Super Signal Indicator. The Super Signal indicator was available for MT5. But there was 2 problems with this indicator
1. It says Array out of range in the Journal in MT5.
2. Doesn't has an alert function.
3. Doesn't Update on the chart. So to see new signal you have to reload the indicator.

After facing lots and lots of trouble i fixed the problems 1 and 2. But still have problem with the issue no 3.

I just need to help to fix the issue no 3. The indicator doesn't update itself. To see the new signal you have to reload the indicator to the chart.

If there's anyone who can help me out then this will be a really big help.

Thanks In Advance,
I've attached the indicator.
 

Attachments

  • super-signals_VHS_Modified.mq5
    14.1 KB · Views: 1,407

mrrich06

Master Trader
Nov 3, 2013
30
15
74
Adding this check after the line #119 should do the trick:
MQL5:
if (limit < 3) limit = 3;

First Of All thanks a lot for the reply.
Respected Admin,
I did as you said. But still i get the signals after reloading the indicator again.
I added the above line after #119 in mq5. But still out of luck. Could you please check and see if I'm still making some mistake? It would be really a great help if you could again clarify me. I'm uploading the Whole Code again.

MQL5:
//---- drawing the indicator in the main window
#property indicator_chart_window
//---- two buffers are used for calculation of drawing of the indicator
#property indicator_buffers 2
//---- only two plots are used
#property indicator_plots   2
//+----------------------------------------------+
//|  Bearish indicator drawing parameters        |
//+----------------------------------------------+
//---- drawing the indicator 1 as a symbol
#property indicator_type1   DRAW_ARROW
//---- DeepPink color is used for the indicator bearish line
#property indicator_color1  clrDeepPink
//---- indicator 1 line width is equal to 4
#property indicator_width1  4
//---- bullish indicator label display
#property indicator_label1  "super-signals Sell"
//+----------------------------------------------+
//|  Bullish indicator drawing parameters        |
//+----------------------------------------------+
//---- drawing the indicator 2 as a line
#property indicator_type2   DRAW_ARROW
//---- DodgerBlue color is used as the color of the bullish line of the indicator
#property indicator_color2  clrDodgerBlue
//---- indicator 2 line width is equal to 4
#property indicator_width2  4
//---- bearish indicator label display
#property indicator_label2 "super-signals Buy"
 
#define RESET 0 // The constant for getting the command for the indicator recalculation back to the terminal
//+----------------------------------------------+
//| Indicator input parameters                   |
//+----------------------------------------------+
input uint dist=5;
//For Alet---------------------------------------
input int    TriggerCandle     = 1;
input bool   EnableNativeAlerts = true;
input bool   EnableSoundAlerts  = true;
 
 
input string SoundFileName    = "alert.wav";
datetime LastAlertTime = D'01.01.1970';
int LastAlertDirection = 0;
//+----------------------------------------------+
 
//---- declaration of dynamic arrays that will further be
// used as indicator buffers
double SellBuffer[];
double BuyBuffer[];
//---- declaration of the integer variables for the start of data calculation
int min_rates_total,ATRPeriod;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
void OnInit()
  {
//---- initialization of global variables  
   ATRPeriod=10;
   min_rates_total=int(MathMax(dist+1,ATRPeriod));
 
//---- set dynamic array as an indicator buffer
   SetIndexBuffer(0,SellBuffer,INDICATOR_DATA);
//---- shifting the start of drawing of the indicator 1
   PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,min_rates_total);
//--- create a label to display in DataWindow
   PlotIndexSetString(0,PLOT_LABEL,"super-signals Sell");
//---- indicator symbol
   PlotIndexSetInteger(0,PLOT_ARROW,108);
//---- indexing elements in the buffer as time series
   ArraySetAsSeries(SellBuffer,true);
//---- setting the indicator values that won't be visible on a chart
   PlotIndexSetDouble(0,PLOT_EMPTY_VALUE,0);
 
//---- set dynamic array as an indicator buffer
   SetIndexBuffer(1,BuyBuffer,INDICATOR_DATA);
//---- shifting the start of drawing of the indicator 2
   PlotIndexSetInteger(1,PLOT_DRAW_BEGIN,min_rates_total);
//--- Create label to display in DataWindow
   PlotIndexSetString(1,PLOT_LABEL,"super-signals Buy");
//---- indicator symbol
   PlotIndexSetInteger(1,PLOT_ARROW,108);
//---- indexing elements in the buffer as time series
   ArraySetAsSeries(BuyBuffer,true);
//---- setting the indicator values that won't be visible on a chart
   PlotIndexSetDouble(1,PLOT_EMPTY_VALUE,0);
 
//---- Setting the format of accuracy of displaying the indicator
   IndicatorSetInteger(INDICATOR_DIGITS,_Digits);
//---- name for the data window and the label for sub-windows
   string short_name="super-signals";
   IndicatorSetString(INDICATOR_SHORTNAME,short_name);
//----  
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
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[])
  {
//---- checking for the sufficiency of bars for the calculation
   if(rates_total<min_rates_total) return(RESET);
 
//---- declaration of local variables
   int limit;
 
//--- calculations of the necessary amount of data to be copied and
//the limit starting index for loop of bars recalculation
   if(prev_calculated>rates_total || prev_calculated<=0)// checking for the first start of the indicator calculation
      limit=rates_total-min_rates_total; // starting index for calculation of all bars
   else limit=int(rates_total-prev_calculated+dist/2); // starting index for calculation of new bars
   if (limit < 3) limit = 3; //<<======================================ADDED THIS LINE HERE.
 
//---- indexing elements in arrays as time series 
   ArraySetAsSeries(low,true);
   ArraySetAsSeries(high,true);
 
//---- main loop of the indicator calculation
   for(int bar=limit-3; bar>=0 && !IsStopped(); bar--)
     {
      double AvgRange=0.0;
                           for(int count=bar; count<=bar+ATRPeriod; count++)
                                    AvgRange+=MathAbs(high[count]-low[count]);
 
      double Range=AvgRange/ATRPeriod;
      Range/=3;
 
      SellBuffer[bar]=0;
      BuyBuffer[bar]=0;
 
      uint barX=bar-dist/2;
      int HH=ArrayMaximum(high,barX,dist);
      int LL=ArrayMinimum(low,barX,dist);
 
      if(bar==HH)
         SellBuffer[bar]=high[HH]+Range;
      if(bar==LL)
         BuyBuffer[bar]=low[LL]-Range;
     }
//----    
//For Alert----------------------------------------------------------
if (((TriggerCandle > 0) && (time[rates_total - 1] > LastAlertTime)) || (TriggerCandle == 0))
{
    string Text;
    // Up Arrow Alert
    if ((BuyBuffer[rates_total - 1 - TriggerCandle] > 0) && ((TriggerCandle > 0) || ((TriggerCandle == 0) && (LastAlertDirection != 1))))
    {
        Text = "Super_Signal: " + Symbol() + " - " + EnumToString(Period()) + " - Up.";
        if (EnableNativeAlerts) Alert(Text);
 
        if (EnableSoundAlerts) PlaySound(SoundFileName);
 
        LastAlertTime = time[rates_total - 1];
        LastAlertDirection = 1;
    }
    // Down Arrow Alert
    if ((SellBuffer[rates_total - 1 - TriggerCandle] > 0) && ((TriggerCandle > 0) || ((TriggerCandle == 0) && (LastAlertDirection != -1))))
    {
        Text = "Super_Signal: " + Symbol() + " - " + EnumToString(Period()) + " - Down.";
        if (EnableNativeAlerts) Alert(Text);
 
        if (EnableSoundAlerts) PlaySound(SoundFileName);
 
        LastAlertTime = time[rates_total - 1];
        LastAlertDirection = -1;
    }
}
//-------------------------------------------------------------------
   return (rates_total);
  }
//+------------------------------------------------------------------+
 

Attachments

  • super-signals_VHS_Modified.mq5
    14.2 KB · Views: 536
  • 👍
Reactions: Enivid

mrrich06

Master Trader
Nov 3, 2013
30
15
74
I can help. But, Let me know if you are sure this indicator is profitable. I can give a try when i get time.

Respected Emili,
I'm really glad that you replied to my post. I've checked this indicator and yes it does work on MT4. The only thing I liked about this indicator is that it signals you before the upcoming trend or we can say before the upcoming opportunity. I usually work on M1 chart. So I've tested it on M1 chart only. I don't know about the other charts. It's just because i like trading Binary Options 60 Seconds. Many user have claimed it works on other time frames too. And according to the Type of Trading Style a user follow. And it works 90% of the time. Sometime even 100%.

I took 3 Times 10 trades. Results are below:

First Time 10 trades: 8 win, 2 loss.
Second Time 10 trades: 10 win, 0 loss.
Third Time 10 trades: 9 win, 1 loss.

I've used it on MT4 not on MT5.
I wanted it on MT5 but there is a bug that i could not solve. The only Bug with MT5 is that this indicator doesn't update itself. I have to reupload it again and again to see the upcoming signal but till i get the signal it's already too late to enter the trade.

It would be really a great help. If you could help me to solve this problem.

Thanks In Advance

PS: You need to use some FILTERS with this indicator to stay away from FALSE signals.
Below is my research that I'm sending you PLEASE HAVE A LOOK.

Research 1:- Some day while searching for the best indicator came across this post---> https://www.forexstrategiesresource...tegies/47-60-seconds-binary-options-strategy/ Some of the users from this post nearly had 99% accuracy with this strategy.

Research 2:- The indicator over here was only for MT4 not for the MT5. So, I thought to give it a try on MT4 on a DEMO account. The strategy works but only 75%-80% of the time. At that time I didn't know why this indicator was only producing 75% accuracy for me. I thought this indicator was some kind of another crap that we usually find on the internet. The accuracy wasn't enough for me so i needed more ACCURACY for the signal. So, I started to do more research and one day i found out that the indicator wasn't the one making mistake, i was the one. I was the one who made mistakes while following this strategy because of which i had only 75% accuracy. The problem was I wasn't following the exact rules for this strategy.

So, I found the clear instruction in these 2 videos:-
Video 1:- http://www.screencast.com/t/IgARAoG3P
Video 2:- http://www.screencast.com/t/QOQ7KOmfh7i


After watching these 2 videos everything got changed. The accuracy from 75% increased to 90% and this was the time i knew that this is the one and it will work. But sadly for me that i can't use it because my Broker uses MT5. What the problem is that i use Binary.com as broker and my personal favorite instrument to trade is Volatility 100 Index which i can't get on MT4 because it's available for MT5 only.

Research 3:- The Most important indicator in this strategy was BB Arrow. But couldn't find it for MT5. Later on I found out that it was Clone of SUPER SIGNAL indicator. So, I found there was SUPER SIGNAL indicator for MT5.
Downloaded it from here.---> https://www.mql5.com/en/code/1490

Research 4:- I downloaded it and started to work on that but again out of luck. Because of these
1. It says Array out of range in the Journal in MT5.
2. Doesn't has an alert function.
3. Doesn't Update on the chart. So to see new signal you have to reload the indicator.

I fixed the issue 1 and 2. But still the 3 remains. So, I need you help. Please help me.
 
Last edited:

mrrich06

Master Trader
Nov 3, 2013
30
15
74
I've fixed the problem no 3 related to auto update. But the problem is that now my indicator doesn't produces alert signals. Now I need it to get it fixed. Need this indicator to produce alert signal. If any one can help then it would be a great help.
 

Attachments

  • super-signals_VHS_Modified(NoAlertSignal).mq5
    12.4 KB · Views: 739

Enivid

Administrator
Staff member
Nov 30, 2008
18,532
1,355
144
Odesa
www.earnforex.com
Why don't you copy the alert code from your the version attached in your original post here? All you have to do there to fix the alerts is to replace notations such as [rates_total - 1] and [rates_total - 1 - TriggerCandle] into [0] and [TriggerCandle].
 
  • 👍
Reactions: mrrich06

Salim Chowdhury

Active Trader
Jul 12, 2018
3
1
39
I've fixed the problem no 3 related to auto update. But the problem is that now my indicator doesn't produces alert signals. Now I need it to get it fixed. Need this indicator to produce alert signal. If any one can help then it would be a great help.

Hello mrrich06,
If you want I can get it done by a professional coder. But the system needs to prove useful at the present time too as it was posted a long time ago in "forex strategies" (more than 4 years ago).
Thanks,
 
  • 👍
Reactions: mrrich06
Jul 1, 2019
1
0
6
56
[QUOTE = "Jama jama, post: 161250, membro: 59518"] Já faz um ano desde que este post esteja aqui, mas você vai adicionar um alerta sonoro ao indicador e voltar aqui para você aqui [/ QUOTE]
Hello!!! Did you implant the alert in the super-signals indicator? Please when you can post here.
 

mrrich06

Master Trader
Nov 3, 2013
30
15
74
Why don't you copy the alert code from your the version attached in your original post here? All you have to do there to fix the alerts is to replace notations such as [rates_total - 1] and [rates_total - 1 - TriggerCandle] into [0] and [TriggerCandle].

Respected Admin,
Sorry for the late reply. I followed your guidelines above and did exactly what you have said. Everything works fine only except there is no alert sound when the arrow appears.

So, i was wondering how do i fix this then suddenly i came up with an idea of adding a small line of code to my function that displays Buy Arrow and Sell Arrow.

for Buy Arrow
MQL5:
printf("Alert function of BUY Arrow has been run.");

for Sell Arrow
MQL5:
printf("Alert function of SELL Arrow has been run.");

I added the above line to my functions just to diagnose the issue. So, after adding it, I fired up the terminal and checked the EXPERTS tab in the terminal and what i found out was that the alert function code does not reaches to the part where the alert is produced at all.

And again at last I'm still left with empty handed without the alert sound produced.

Maybe there might be some mistake made by me so can you please have a look on the below code.

MQL5:
//+------------------------------------------------------------------+
//|                                                super-signals.mq5 |
//|                Copyright © 2006, Nick Bilak, beluck[AT]gmail.com |
//|                                        http://www.forex-tsd.com/ |
//+------------------------------------------------------------------+
#property copyright "CCopyright © 2006, Nick Bilak, beluck[AT]gmail.com"
#property link "http://www.forex-tsd.com/"
#property description "super-signals"
//---- indicator version number
#property version   "1.00"
//---- drawing the indicator in the main window
#property indicator_chart_window
//---- two buffers are used for calculation of drawing of the indicator
#property indicator_buffers 2
//---- only two plots are used
#property indicator_plots   2
//+----------------------------------------------+
//|  Bearish indicator drawing parameters        |
//+----------------------------------------------+
//---- drawing the indicator 1 as a symbol
#property indicator_type1   DRAW_ARROW
//---- DeepPink color is used for the indicator bearish line
#property indicator_color1  clrDeepPink
//---- indicator 1 line width is equal to 4
#property indicator_width1  2
//---- bullish indicator label display
#property indicator_label1  "super-signals Sell"
//+----------------------------------------------+
//|  Bullish indicator drawing parameters        |
//+----------------------------------------------+
//---- drawing the indicator 2 as a line
#property indicator_type2   DRAW_ARROW
//---- DodgerBlue color is used as the color of the bullish line of the indicator
#property indicator_color2  clrDodgerBlue
//---- indicator 2 line width is equal to 4
#property indicator_width2  2
//---- bearish indicator label display
#property indicator_label2 "super-signals Buy"
 
#define RESET 0 // The constant for getting the command for the indicator recalculation back to the terminal
//+----------------------------------------------+
//| Indicator input parameters                   |
//+----------------------------------------------+
input uint dist=5;
//For Alet---------------------------------------
input int    TriggerCandle=1;
input bool   EnableNativeAlerts = true;
input bool   EnableSoundAlerts  = true;
 
 
input string SoundFileName="alert.wav";
 
datetime LastAlertTime = D'01.01.1970';
int LastAlertDirection = 0;
//+----------------------------------------------+
 
//---- declaration of dynamic arrays that will further be
// used as indicator buffers
double SellBuffer[];
double BuyBuffer[];
//---- declaration of the integer variables for the start of data calculation
int min_rates_total,ATRPeriod;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
void OnInit()
  {
//---- initialization of global variables  
   ATRPeriod=10;
   min_rates_total=int(MathMax(dist+1,ATRPeriod));
 
//---- set dynamic array as an indicator buffer
   SetIndexBuffer(0,SellBuffer,INDICATOR_DATA);
//---- shifting the start of drawing of the indicator 1
   PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,min_rates_total);
//--- create a label to display in DataWindow
   PlotIndexSetString(0,PLOT_LABEL,"super-signals Sell");
//---- indicator symbol
   PlotIndexSetInteger(0,PLOT_ARROW,242);
//---- indexing elements in the buffer as time series
   ArraySetAsSeries(SellBuffer,true);
//---- setting the indicator values that won't be visible on a chart
   PlotIndexSetDouble(0,PLOT_EMPTY_VALUE,0);
 
//---- set dynamic array as an indicator buffer
   SetIndexBuffer(1,BuyBuffer,INDICATOR_DATA);
//---- shifting the start of drawing of the indicator 2
   PlotIndexSetInteger(1,PLOT_DRAW_BEGIN,min_rates_total);
//--- Create label to display in DataWindow
   PlotIndexSetString(1,PLOT_LABEL,"super-signals Buy");
//---- indicator symbol
   PlotIndexSetInteger(1,PLOT_ARROW,241);
//---- indexing elements in the buffer as time series
   ArraySetAsSeries(BuyBuffer,true);
//---- setting the indicator values that won't be visible on a chart
   PlotIndexSetDouble(1,PLOT_EMPTY_VALUE,0);
 
//---- Setting the format of accuracy of displaying the indicator
   IndicatorSetInteger(INDICATOR_DIGITS,_Digits);
//---- name for the data window and the label for sub-windows
   string short_name="super-signals";
   IndicatorSetString(INDICATOR_SHORTNAME,short_name);
//----  
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
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[])
  {
//---- checking for the sufficiency of bars for the calculation
   if(rates_total<min_rates_total) return(RESET);
 
//---- declaration of local variables
   int limit;
 
//--- calculations of the necessary amount of data to be copied and
//the limit starting index for loop of bars recalculation
   if(prev_calculated>rates_total || prev_calculated<=0)// checking for the first start of the indicator calculation
      limit=rates_total-min_rates_total; // starting index for calculation of all bars
   else limit=int(rates_total-prev_calculated+dist/2); // starting index for calculation of new bars
 
//---- indexing elements in arrays as time series 
   ArraySetAsSeries(low,true);
   ArraySetAsSeries(high,true);
 
//---- main loop of the indicator calculation
   for(int bar=0; bar<limit && !IsStopped(); bar++)
     {
      double AvgRange=0.0;
      for(int count=bar; count<=bar+ATRPeriod; count++) AvgRange+=MathAbs(high[count]-low[count]);
      double Range=AvgRange/ATRPeriod;
      Range/=3;
 
      SellBuffer[bar]=0;
      BuyBuffer[bar]=0;
 
      uint barX=bar-dist/2;
      int HH=ArrayMaximum(high,barX,dist);
      int LL=ArrayMinimum(low,barX,dist);
 
 
      if(bar==HH) SellBuffer[bar]=high[HH]+Range;
      if(bar==LL) BuyBuffer[bar]=low[LL]-Range;
     }
//----
//For Alert----------------------------------------------------------
   if(((TriggerCandle>0) && (time[0]>LastAlertTime)) || (TriggerCandle==0))
     {
 
      string Text;
      // Up Arrow Alert
      if((BuyBuffer[TriggerCandle]>0) && ((TriggerCandle>0) || ((TriggerCandle==0) && (LastAlertDirection!=1))))
        {
         printf("Alert function of BUY Arrow has been run.");
         Text="Super_Signal: "+Symbol()+" - "+EnumToString(Period())+" - Up.";
         if(EnableNativeAlerts) Alert(Text);
 
         if(EnableSoundAlerts) PlaySound(SoundFileName);
 
         LastAlertTime=time[0];
         LastAlertDirection=1;
        }
      // Down Arrow Alert
      if((SellBuffer[TriggerCandle]>0) && ((TriggerCandle>0) || ((TriggerCandle==0) && (LastAlertDirection!=-1))))
        {
         printf("Alert function of SELL Arrow has been run.");
         Text="Super_Signal: "+Symbol()+" - "+EnumToString(Period())+" - Down.";
         if(EnableNativeAlerts) Alert(Text);
 
         if(EnableSoundAlerts) PlaySound(SoundFileName);
 
         LastAlertTime=time[0];
         LastAlertDirection=-1;
        }
     }
//-------------------------------------------------------------------    
   return(rates_total);
  }
//+------------------------------------------------------------------+
 

mrrich06

Master Trader
Nov 3, 2013
30
15
74
Hello mrrich06,
If you want I can get it done by a professional coder. But the system needs to prove useful at the present time too as it was posted a long time ago in "forex strategies" (more than 4 years ago).
Thanks,

Respected Salim,
I'm really grateful to you for your reply. So, as per you query it's true that this system is very old but i checked this system and it works fine as expected. Just need to add a filter to stay away from the false signals.

I also checked from the previous post where it was posted at first.
Resource: https://www.forexstrategiesresource...tegies/47-60-seconds-binary-options-strategy/

And I've attached the screenshot of what other users says of this system.

Screenshot_2019-07-04 60 seconds Binary Options strategy.png


Thanks in Advance, if you still wish to help.
 
Last edited:

Enivid

Administrator
Staff member
Nov 30, 2008
18,532
1,355
144
Odesa
www.earnforex.com
Respected Admin,
Sorry for the late reply. I followed your guidelines above and did exactly what you have said. Everything works fine only except there is no alert sound when the arrow appears.

So, i was wondering how do i fix this then suddenly i came up with an idea of adding a small line of code to my function that displays Buy Arrow and Sell Arrow.

for Buy Arrow
MQL5:
printf("Alert function of BUY Arrow has been run.");

for Sell Arrow
MQL5:
printf("Alert function of SELL Arrow has been run.");

I added the above line to my functions just to diagnose the issue. So, after adding it, I fired up the terminal and checked the EXPERTS tab in the terminal and what i found out was that the alert function code does not reaches to the part where the alert is produced at all.

And again at last I'm still left with empty handed without the alert sound produced.

Maybe there might be some mistake made by me so can you please have a look on the below code.

MQL5:
//+------------------------------------------------------------------+
//|                                                super-signals.mq5 |
//|                Copyright © 2006, Nick Bilak, beluck[AT]gmail.com |
//|                                        http://www.forex-tsd.com/ |
//+------------------------------------------------------------------+
#property copyright "CCopyright © 2006, Nick Bilak, beluck[AT]gmail.com"
#property link "http://www.forex-tsd.com/"
#property description "super-signals"
//---- indicator version number
#property version   "1.00"
//---- drawing the indicator in the main window
#property indicator_chart_window
//---- two buffers are used for calculation of drawing of the indicator
#property indicator_buffers 2
//---- only two plots are used
#property indicator_plots   2
//+----------------------------------------------+
//|  Bearish indicator drawing parameters        |
//+----------------------------------------------+
//---- drawing the indicator 1 as a symbol
#property indicator_type1   DRAW_ARROW
//---- DeepPink color is used for the indicator bearish line
#property indicator_color1  clrDeepPink
//---- indicator 1 line width is equal to 4
#property indicator_width1  2
//---- bullish indicator label display
#property indicator_label1  "super-signals Sell"
//+----------------------------------------------+
//|  Bullish indicator drawing parameters        |
//+----------------------------------------------+
//---- drawing the indicator 2 as a line
#property indicator_type2   DRAW_ARROW
//---- DodgerBlue color is used as the color of the bullish line of the indicator
#property indicator_color2  clrDodgerBlue
//---- indicator 2 line width is equal to 4
#property indicator_width2  2
//---- bearish indicator label display
#property indicator_label2 "super-signals Buy"
 
#define RESET 0 // The constant for getting the command for the indicator recalculation back to the terminal
//+----------------------------------------------+
//| Indicator input parameters                   |
//+----------------------------------------------+
input uint dist=5;
//For Alet---------------------------------------
input int    TriggerCandle=1;
input bool   EnableNativeAlerts = true;
input bool   EnableSoundAlerts  = true;
 
 
input string SoundFileName="alert.wav";
 
datetime LastAlertTime = D'01.01.1970';
int LastAlertDirection = 0;
//+----------------------------------------------+
 
//---- declaration of dynamic arrays that will further be
// used as indicator buffers
double SellBuffer[];
double BuyBuffer[];
//---- declaration of the integer variables for the start of data calculation
int min_rates_total,ATRPeriod;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
void OnInit()
  {
//---- initialization of global variables
   ATRPeriod=10;
   min_rates_total=int(MathMax(dist+1,ATRPeriod));
 
//---- set dynamic array as an indicator buffer
   SetIndexBuffer(0,SellBuffer,INDICATOR_DATA);
//---- shifting the start of drawing of the indicator 1
   PlotIndexSetInteger(0,PLOT_DRAW_BEGIN,min_rates_total);
//--- create a label to display in DataWindow
   PlotIndexSetString(0,PLOT_LABEL,"super-signals Sell");
//---- indicator symbol
   PlotIndexSetInteger(0,PLOT_ARROW,242);
//---- indexing elements in the buffer as time series
   ArraySetAsSeries(SellBuffer,true);
//---- setting the indicator values that won't be visible on a chart
   PlotIndexSetDouble(0,PLOT_EMPTY_VALUE,0);
 
//---- set dynamic array as an indicator buffer
   SetIndexBuffer(1,BuyBuffer,INDICATOR_DATA);
//---- shifting the start of drawing of the indicator 2
   PlotIndexSetInteger(1,PLOT_DRAW_BEGIN,min_rates_total);
//--- Create label to display in DataWindow
   PlotIndexSetString(1,PLOT_LABEL,"super-signals Buy");
//---- indicator symbol
   PlotIndexSetInteger(1,PLOT_ARROW,241);
//---- indexing elements in the buffer as time series
   ArraySetAsSeries(BuyBuffer,true);
//---- setting the indicator values that won't be visible on a chart
   PlotIndexSetDouble(1,PLOT_EMPTY_VALUE,0);
 
//---- Setting the format of accuracy of displaying the indicator
   IndicatorSetInteger(INDICATOR_DIGITS,_Digits);
//---- name for the data window and the label for sub-windows
   string short_name="super-signals";
   IndicatorSetString(INDICATOR_SHORTNAME,short_name);
//----
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
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[])
  {
//---- checking for the sufficiency of bars for the calculation
   if(rates_total<min_rates_total) return(RESET);
 
//---- declaration of local variables
   int limit;
 
//--- calculations of the necessary amount of data to be copied and
//the limit starting index for loop of bars recalculation
   if(prev_calculated>rates_total || prev_calculated<=0)// checking for the first start of the indicator calculation
      limit=rates_total-min_rates_total; // starting index for calculation of all bars
   else limit=int(rates_total-prev_calculated+dist/2); // starting index for calculation of new bars
 
//---- indexing elements in arrays as time series
   ArraySetAsSeries(low,true);
   ArraySetAsSeries(high,true);
 
//---- main loop of the indicator calculation
   for(int bar=0; bar<limit && !IsStopped(); bar++)
     {
      double AvgRange=0.0;
      for(int count=bar; count<=bar+ATRPeriod; count++) AvgRange+=MathAbs(high[count]-low[count]);
      double Range=AvgRange/ATRPeriod;
      Range/=3;
 
      SellBuffer[bar]=0;
      BuyBuffer[bar]=0;
 
      uint barX=bar-dist/2;
      int HH=ArrayMaximum(high,barX,dist);
      int LL=ArrayMinimum(low,barX,dist);
 
 
      if(bar==HH) SellBuffer[bar]=high[HH]+Range;
      if(bar==LL) BuyBuffer[bar]=low[LL]-Range;
     }
//----
//For Alert----------------------------------------------------------
   if(((TriggerCandle>0) && (time[0]>LastAlertTime)) || (TriggerCandle==0))
     {
 
      string Text;
      // Up Arrow Alert
      if((BuyBuffer[TriggerCandle]>0) && ((TriggerCandle>0) || ((TriggerCandle==0) && (LastAlertDirection!=1))))
        {
         printf("Alert function of BUY Arrow has been run.");
         Text="Super_Signal: "+Symbol()+" - "+EnumToString(Period())+" - Up.";
         if(EnableNativeAlerts) Alert(Text);
 
         if(EnableSoundAlerts) PlaySound(SoundFileName);
 
         LastAlertTime=time[0];
         LastAlertDirection=1;
        }
      // Down Arrow Alert
      if((SellBuffer[TriggerCandle]>0) && ((TriggerCandle>0) || ((TriggerCandle==0) && (LastAlertDirection!=-1))))
        {
         printf("Alert function of SELL Arrow has been run.");
         Text="Super_Signal: "+Symbol()+" - "+EnumToString(Period())+" - Down.";
         if(EnableNativeAlerts) Alert(Text);
 
         if(EnableSoundAlerts) PlaySound(SoundFileName);
 
         LastAlertTime=time[0];
         LastAlertDirection=-1;
        }
     }
//-------------------------------------------------------------------  
   return(rates_total);
  }
//+------------------------------------------------------------------+

There is a problem with the indicator code and there is a problem with how the alerts are added.

The indicator's code should be fixed by adding this line:
MQL5:
if (bar-(int)dist/2 < 0) barX = 0;
after this one:
MQL5:
uint barX=bar-dist/2;

The problem with the alerts is that they use time[] array as if it had been set to timeseries format, but only high[] and low[] arrays are actually set to series = true. It is fixed by adding this line:
MQL5:
ArraySetAsSeries(time,true);
after this one:
MQL5:
ArraySetAsSeries(high,true);
 
  • 👍
Reactions: mrrich06

mrrich06

Master Trader
Nov 3, 2013
30
15
74
There is a problem with the indicator code and there is a problem with how the alerts are added.

The indicator's code should be fixed by adding this line:
MQL5:
if (bar-(int)dist/2 < 0) barX = 0;
after this one:
MQL5:
uint barX=bar-dist/2;

The problem with the alerts is that they use time[] array as if it had been set to timeseries format, but only high[] and low[] arrays are actually set to series = true. It is fixed by adding this line:
MQL5:
ArraySetAsSeries(time,true);
after this one:
MQL5:
ArraySetAsSeries(high,true);

Respected Admin,
Thanks a lot for giving me your precious time to solve my issue. The issue with the alert sound has been solved with your advice. Just now at present i'm trying to add little bit of more features to that indicator to make it more accurate. I'll upload it here after it has been completed.
 
  • 👍
Reactions: Tman
Jul 11, 2019
2
0
7
26
mrrich06,
the signal appears after the completion of two candles how do i trade??
after the completion of the candle in which the signal has appeared we have to trade on the next candle but the signal appears after the completion of two candles what should i do ??
please solve this issue
 

Attachments

  • Screenshot (86).png
    Screenshot (86).png
    88.8 KB · Views: 833

mrrich06

Master Trader
Nov 3, 2013
30
15
74
[QUOTE = "Jama jama, post: 161250, membro: 59518"] Já faz um ano desde que este post esteja aqui, mas você vai adicionar um alerta sonoro ao indicador e voltar aqui para você aqui [/ QUOTE]
Hello!!! Did you implant the alert in the super-signals indicator? Please when you can post here.

Gilmar Carvalho
The alert has been added and I've made some minor changes for smooth trading.
Credit goes to Enivid (Administrator,Staff Member) of earnforex.com for the help and support.

Checkout the new indicator "BrahmastraV1" formerly know as "super-signals_vhs_modified".
 

Attachments

  • BrahmastraV1.mq5
    15.7 KB · Views: 793

mrrich06

Master Trader
Nov 3, 2013
30
15
74
mrrich06,
the signal appears after the completion of two candles how do i trade??
after the completion of the candle in which the signal has appeared we have to trade on the next candle but the signal appears after the completion of two candles what should i do ??
please solve this issue

Sayed Mufez Fazil,
First of all i would like to thank you for using the indicator and finding out the issues. It's great to know the issue so that it can be solved. The issue has been fixed. And I've uploaded the indicator here.

Upcoming days i'll add some more feature and filters, so that it can be more and more accurate for trading.

Checkout the new indicator "BrahmastraV1" formerly know as "super-signals_vhs_modified".
 

Attachments

  • BrahmastraV1.mq5
    15.7 KB · Views: 925
Last edited:
  • 👍
Reactions: Enivid