Indicators: Breakout

 

Breakout:

An indicator of levels. The indicator allows setting:
  • the hour and minute of the beginning of the "period" zone
  • the hour and minute of the end of the "period" zone
  • the hour and minute of the end of the "area"
    The "area" zone begins right after the end of the "period" zone

It has five input parameters:

  • "Period" Hour begin - the hour of the beginning of the period zone
  • "Period" Minutes begin - the minute of the beginning of the period zone
  • "Period" Hour end - the hour of the end of the period zone
  • "Period" Minutes end - the minute of the end of the period zone
  • "Area" Hour end - the hour of the end of the area zone
  • "Area" Minutes end - the minute of the end of the area zone

Author: Scriptor

 
Great indicator. There is room for improvement. Alert/push notification could be added in case the price touches the support/resistance line
 

hello thanks for share !!!   i have a problem because it just  working in 5m time frame . In 15m 1h doesn't work .  Have some one any idea ?


thanks

 
Please how do i make this work for a One minute timeframe
 

Hi I downloaded you indicator and trying to read the value but I am getting "Array out of range" error.

Could you please help me. Thanks


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

//|                                          Custom_Indicator_EA.mq5 |

//|                                  Copyright 2022, MetaQuotes Ltd. |

//|                                             https://www.mql5.com |

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

#property copyright "Copyright 2022, MetaQuotes Ltd."

#property link      "https://www.mql5.com"

#property version   "1.00"

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

//| Expert initialization function                                   |

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






#define BreakIndicator  "Indicators\\Breakout.ex5"

#resource "\\" + BreakIndicator;


int break_handle;

input ENUM_TIMEFRAMES TimeFrame = PERIOD_CURRENT;


double upperPeriod[], lowerPeriod[];

double upperArea[], lowerArea[];


int OnInit()

  {

  

 

     //--- create handle of the indicator iCustom 

      break_handle= iCustom(_Symbol, TimeFrame, "::" + BreakIndicator); //, 0 ,0,5,0,23,0,0);

      


   //--- if the handle is not created

      if(break_handle==INVALID_HANDLE)

        {

         //--- tell about the failure and output the error code

         PrintFormat("Failed to create handle of the iCustom indicator for the symbol %s/%s, error code %d",

                     Symbol(),

                     EnumToString(Period()),

                     GetLastError());

         //--- the indicator is stopped early

         return(INIT_FAILED);

        }

        

        return(INIT_SUCCEEDED);

}      

 

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

//| Expert deinitialization function                                 |

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

void OnDeinit(const int reason)

  {

   

   IndicatorRelease(break_handle);

   

  }

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

//| Expert tick function                                             |

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

void OnTick()

  {





ArraySetAsSeries(upperPeriod,true);

//ArraySetAsSeries(lowerPeriod,true);

//ArraySetAsSeries(upperArea,true);

//ArraySetAsSeries(lowerArea,true);




      

 

   //--- get the data from the indicators buffer and copy it

   CopyBuffer(break_handle , 0, 0,  0, upperPeriod);



//CopyBuffer(break_handle, 0, 0, 0, upperPeriod);

//CopyBuffer(break_handle, 1, 1, 1, lowerPeriod);

//CopyBuffer(break_handle, 0, 0, 0, upperArea);

//CopyBuffer(break_handle, 1, 0, 1, lowerArea);

   //We calculate the value of the current candle

   double value = upperPeriod[1];

   double value2 = upperPeriod[1];

   //double value3 = upperPeriod[2];

   //double value4 = upperPeriod[3];

   

   

  

  

  

Comment(

"\nBreak_handle: ", break_handle,

"\nUpper Value is : ", value,

"\nUpper Value is : ", value2

   //"\nUpper Period: ", upperPeriod[0]

  // "\nLower Period: ", lowerPeriod[0]

   // "\nUpper Area: ", upperArea[0],

   //  "\nLower Area: ", lowerArea[0]

  ) ;

   

   

   

  }


Discover new MetaTrader 5 opportunities with MQL5 community and services
Discover new MetaTrader 5 opportunities with MQL5 community and services
  • 2022.10.12
  • www.mql5.com
MQL5: language of trade strategies built-in the MetaTrader 5 Trading Platform, allows writing your own trading robots, technical indicators, scripts and libraries of functions
 
hello, i love this indicator much, but i have a trouble since it draws all of the day, can you please modify this indicator, so only display in the current day only? thank you very much, appreciate your help.
 
hai, can i get in mt4
Reason: