EA999 Strong BreakOut Manual

EA999 Strong BreakOut Manual

29 三月 2022, 08:42
Zhen Yu Li
0
76

Strong K BreakOut Indicator

This manual only for indicator :"EA999 Strong K BreakOut "

✔️ K Strong BreakOut Indicator: MT5 ©: https://www.mql5.com/zh/market/product/78961
✔️ K Strong BreakOut Indicator: MT4 ©: https://www.mql5.com/zh/market/product/79151


V1.2 upgrade, in order to EA can read the signal, special upgrade, as follows:


V1.2 升级, 为了EA能读取信号,特为此升级,用法如下:

获得信号示例:

请注意,不要读取当前K线的信号,因为没有收盘前,当前K线的信号是不准确的,至少要读取前一根K线的信号。

请注意,读取的Bufferindex, 0 为多,1为空,因为之前为了画彩K,占用了前面的Buffer。

为了方便引用,我采用的函数方式获取。


Examples of get signals from indicator:

Please note, do not read the current K line signal, because the current K line signal is not accurate before the close, at least read the previous K line signal.

Note that the Bufferindex read 0  is for long and 1 is for short because some buffers was used to draw K.

For ease of reference, I use the function method to get.

//For MT5

#include <errordescription.mqh>

#include <StdlibErr.mqh>

//Please add the above two lines of code to the EA header


//For long buy example code:

      double SignalBuy = iGetIndicator(NULL,PERIOD_CURRENT,0,1);

      if(SignalBuy!=EMPTY_VALUE)

        {

         //long, buy signal

         break;

        }

      else

        {

         Print("Buy Signal: Not available");

        }

//For shot sell example code:

      double SignalSell = iGetIndicator(NULL,PERIOD_CURRENT,1,1);

      if(SignalSell!=EMPTY_VALUE)

        {

//short sell

         Print("Sell Signal: OK, do something");

         break;

        }

      else

        {

         Print("Sell Signal: Not available");

        }

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

//|                                                                  |

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

double iGetIndicator(string symbol,

                     ENUM_TIMEFRAMES tf,

                     int bufferindex,

                     int shift)

  {

   int handle=iCustom(symbol,tf,"EA999 Strong K Breakout 1.2");

   if(handle<0)

     {

      Print("iCustom indicator create error:",ErrorDescription(GetLastError()));

      return(-1);

     }

   else

      return(CopyBufferMQL4(handle,bufferindex,shift));

  }



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

double CopyBufferMQL4(int handle,int index,int shift)

  {

   double buf[];

   switch(index)

     {

      case 0:

         if(CopyBuffer(handle,0,shift,1,buf)>0)

            return(buf[0]);

         break;

      case 1:

         if(CopyBuffer(handle,1,shift,1,buf)>0)

            return(buf[0]);

         break;

      case 2:

         if(CopyBuffer(handle,2,shift,1,buf)>0)

            return(buf[0]);

         break;

      case 3:

         if(CopyBuffer(handle,3,shift,1,buf)>0)

            return(buf[0]);

         break;

      case 4:

         if(CopyBuffer(handle,4,shift,1,buf)>0)

            return(buf[0]);

         break;

      case 5:

         if(CopyBuffer(handle,5,shift,1,buf)>0)

            return(buf[0]);

      case 6:

         if(CopyBuffer(handle,6,shift,1,buf)>0)

            return(buf[0]);

      case 7:

         if(CopyBuffer(handle,7,shift,1,buf)>0)

            return(buf[0]);

      case 8:

         if(CopyBuffer(handle,8,shift,1,buf)>0)

            return(buf[0]);

      case 9:

         if(CopyBuffer(handle,9,shift,1,buf)>0)

            return(buf[0]);

      case 10:

         if(CopyBuffer(handle,10,shift,1,buf)>0)

            return(buf[0]);

      case 11:

         if(CopyBuffer(handle,11,shift,1,buf)>0)

            return(buf[0]);

         break;

      default:

         break;

     }

   return(EMPTY_VALUE);

  }



// For MT4 V1.2

// Read buffer 0 for buy, buffer 4 for sell.

// Ger previous K line signal, Because the current K-line signal is not accurate before the market closes

double buysignal = iCustom(Symbol(),PERIOD_CURRENT,"EA999 Strong K Breakout 1.2",80,1.8,450,-450,false,false,clrRed,clrMagenta,0,1);

double sellsignal = iCustom(Symbol(),PERIOD_CURRENT,"EA999 Strong K Breakout 1.2",80,1.8,450,-450,false,false,clrRed,clrMagenta,4,1);

   

   if (buysignal != EMPTY_VALUE)

   {

   // do something for buy signal

   }

   

   if (sellsignal != EMPTY_VALUE)

   {

   // do something for sell signal

   }