Indicator not working with MT2 trading

 

Hello, I have an indicator that I'm trying to use with the MT2 trading connector. However MT2 is not recognizing the signal even though I select the correct buffers. can someone please check it and let me know if something should be changed on the code? 


The way that indicator works is that if the price breaks a S/R level it displays and alert and an arrow in the chart. The alert and the arrows are displayed but Mt2 doesn't receive the signal. The buffers that I select are the 2 and the 3. Below you can see the code. 


#property copyright "Copyright © 2004 Barry Stander; Arrow alerts by Lennoi Anderson, 2015."

#property indicator_chart_window

#property indicator_buffers 4

#property indicator_color1 Blue

#property indicator_color2 Red

#property indicator_color3 Blue

#property indicator_color4 Magenta

#property indicator_width3 2

#property indicator_width4 2



extern bool RSICCI_Filter = FALSE;

extern double RSIPeriod = 14;

extern double RSIOverbought = 75;

extern double RSIOversold = 25;

extern double CCIPeriod = 14;

extern double CCIBuyLevel = 50;

extern double CCISellLevel = -50;

extern bool HighLow = FALSE;

extern int SignalDots = 3;

extern bool Alerts = TRUE;

extern bool AlertOnClose = TRUE;

extern int BarCount = 10000; 



bool HighBreakout = FALSE;

bool HighBreakPending = FALSE;        

bool LowBreakout = FALSE;

bool LowBreakPending = FALSE; 

double LastResistance = 0;

double LastSupport = 0;

double AlertBar = 0;

//---- buffers

double v1[];

double v2[];

double BreakUp[];

double BreakDown[];

double val1;

double val2;

int counter1;

int counter2;

//+------------------------------------------------------------------+

//|                                                                  |

//+------------------------------------------------------------------+  

int init()

{

//---- drawing settings

   SetIndexArrow(0, 119);

   SetIndexArrow(1, 119);

//----  

   SetIndexStyle(0, DRAW_ARROW, STYLE_DOT, 0, Red);

   //SetIndexDrawBegin(0, i-1);

   SetIndexBuffer(0, v1);

   SetIndexLabel(0, "Resistance");

//----    

   SetIndexStyle(1, DRAW_ARROW, STYLE_DOT, 0, Blue);

   //SetIndexDrawBegin(1, i-1);

   SetIndexBuffer(1, v2);

   SetIndexLabel(1, "Support");

//---- 

   SetIndexStyle(2, DRAW_ARROW, EMPTY, 2);

   SetIndexArrow(2, 233);

   SetIndexBuffer(2, BreakUp);

//----   

   SetIndexStyle(3, DRAW_ARROW, EMPTY, 2);

   SetIndexArrow(3, 234);

   SetIndexBuffer(3, BreakDown);

   return(0);

}

//+------------------------------------------------------------------+

int start()

{   

//----

   for(int i = BarCount; i >=0; i--)

   {   

       val1 = iFractals(NULL, 0, MODE_UPPER, i);

       //----

       if(val1 > 0)

       { 

           v1[i] = High[i];

           counter1 = 1;          

       }

       else

       {

           v1[i] = v1[i+1];

           counter1++;           

       }

       val2 = iFractals(NULL, 0, MODE_LOWER, i);

       //----

       if(val2 > 0)

       { 

           v2[i] = Low[i];

           counter2 = 1;     

       }

       else

       {

           v2[i] = v2[i+1];

           counter2++;        

       }

                    

       if (v1[i] != LastResistance) { HighBreakPending = True; LastResistance = v1[i]; }

       if (v2[i] != LastSupport) { LowBreakPending = True; LastSupport = v2[i]; }  

       

       if (HighLow) double BPrice=High[i]; else BPrice=Close[i];            

       if (HighBreakPending && BPrice > v1[i] && (!RSICCI_Filter || (RSICCI_Filter && iRSI(NULL, 0, RSIPeriod, PRICE_CLOSE, i) < RSIOverbought && 

           iCCI(Symbol(), NULL, CCIPeriod, PRICE_CLOSE, i) > CCIBuyLevel)) && counter1 >= SignalDots) HighBreakout = TRUE;

       if (HighLow) BPrice=Low[i]; else BPrice=Close[i];    

       if (LowBreakPending && BPrice < v2[i] && (!RSICCI_Filter || (RSICCI_Filter && iRSI(NULL, 0, RSIPeriod, PRICE_CLOSE, i) > RSIOversold && 

           iCCI(Symbol(), NULL, CCIPeriod, PRICE_CLOSE, i) < CCISellLevel)) && counter2 >= SignalDots) LowBreakout = TRUE; 

           

       if (AlertOnClose) int AlertCandle = 1; else AlertCandle = 0;         

       

       if (HighBreakout) 

       {          

         if (i >= AlertCandle) BreakUp[i] = Low[i]-10*Point;

         if (Alerts && i == AlertCandle && Bars > AlertBar) 

         { 

           Alert(Symbol(), " M", Period(), ": Resistance Breakout: BUY");

           AlertBar = Bars;

         } 

         HighBreakout = False; 

         HighBreakPending = False;

       } else

       if (LowBreakout) 

       { 

         if (i >= AlertCandle) BreakDown[i] = High[i]+10*Point;              

         if (Alerts && i==AlertCandle && Bars>AlertBar)

         {  

           Alert(Symbol(), " M", Period(), ": Support Breakout: SELL");

           AlertBar = Bars;

         }

         LowBreakout = False;

         LowBreakPending = False;

       }    

   }  

   return(0);

}
 
  1. Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
              General rules and best pratices of the Forum. - General - MQL5 programming forum 2019.05.06
              Messages Editor

  2. Post in the correct place.

  3. Don't double post! You already had this thread open.
              General rules and best pratices of the Forum. - General - MQL5 programming forum 2017.07.19

  4. Omar Rodriguez: I'm trying to use with the MT2 trading connector. However MT2 is n

    I have never hard of MT2 and have read only one reference to MT3 (posted in 2006). Your code is MT4 and you posted in the MT5 section.
         How To Ask Questions The Smart Way. 2004
              Be precise and informative about your problem

  5. Omar Rodriguez: Mt2 doesn't receive the signal. The buffers that I select are the 2 and the 3. Below you can see the code. 
    See the code below? From the indicator all we needed was the parameters. You need to post the iCustom code that you use to read the indicator. That is what your question is about.
 

Don't double post! You already had another thread open.

          General rules and best pratices of the Forum. - General - MQL5 programming forum 2017.07.19
 
William Roeder:

Don't double post! You already had another thread open.

          General rules and best pratices of the Forum. - General - MQL5 programming forum 2017.07.19
Hello, I was informed by someone that I needed to put the thread in a different section beore posting this. I deleted the old post.
 
Omar Rodriguez: Hello, I was informed by someone that I needed to put the thread in a different section beore posting this. I deleted the old post.

No, you were not. A moderator told you “in future please post in the correct section. I will move your topic to the MQL4 and Metatrader 4 section.”

The original post still exists, and as been answered.

Keith Watford: I have deleted your duplicate topic.

And now that answer is at #1

 
William Roeder:
  1. Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
              General rules and best pratices of the Forum. - General - MQL5 programming forum 2019.05.06
              Messages Editor

  2. Post in the correct place.

  3. Don't double post! You already had this thread open.
              General rules and best pratices of the Forum. - General - MQL5 programming forum 2017.07.19

  4. I have never hard of MT2 and have read only one reference to MT3 (posted in 2006). Your code is MT4 and you posted in the MT5 section.
         How To Ask Questions The Smart Way. 2004
              Be precise and informative about your problem

  5. See the code below? From the indicator all we needed was the parameters. You need to post the iCustom code that you use to read the indicator. That is what your question is about.
Sorry I taught I had deleted this post before posting the new one. I now see that it's still here. In regards to your concern MT2 is a plattaform that was released  not too long ago that allows MT4 to be connected to binary options brokers. 
 
Omar Rodriguez:

I have deleted your duplicate topic.

 
William Roeder:

And now that answer has been lost.

I have moved the 2 replies here

 
Omar Rodriguez MT2 is a plattaform that was released  not too long ago that allows MT4 to be connected to binary options brokers. 

Post the link.

Reason: