Forum

Alert when bar breaks current daily high/low

Hello, How can I, in an indicator, detect when the current bar closes and breaks the current daily high/low? I need to check when a bar closes, if it breaks the daily high/low so far, from the first daily bar to the last bar (not counting the current bar). If I use " iHigh ( NULL , PERIOD_D1 ,0) I

Global variables definition

Hello, I have global variables in an include file, defined like this include.mqh double variable1 = 5 ; then I use this include for different indicators, eas and scripts. script 1 #include <include.mqh> indicator 1 #include <include.mqh> expert 1 #include <include.mqh> If I initialize the variable

MT5 Charts freeze - How can I find the problem ?

Hi, I have MT5 open with 5 or 6 charts. I use an expert advisor and various custom indicators . The charts move automatically, each tick is refreshed. But there comes a time, some chart stops, the ticks do not update, as if the market were stopped. The only way to refresh and resume tick event is by

Generic funcion to iterate

Hi, I use the loop for all open charts a lot of times on my code. So I'm repeating the code a lot. Is there any way to create a generic function to iterate the charts, and do something variable? Something like this void sample() { iterateCharts ( do something complex ); } void

Error getting iBarShift when opening MT5

Hi, the first time the indicator is executed when opening MT5, it fails to get iBarShift function, the second or third time the event OnCalculate is executed, it works OK int OnCalculate ( const int rates_total, const int prev_calculated, const datetime &time[]

Convert any datetime to UTC - MQL5

Hi, Is it possible to convert any date on a specific zone to UTC? For example if I have 10/10/2021 in the 'Europe/London' zone, how could change it to UTC (taking into account the daylight saving)? In javascript there is momentjs library, but I don't know how to do it in MQL5 Thanks

Indicator that resets suddenly

Hi I have programmed an indicator to mark the high and low of the previous day, the weekly and the ADR. The indicator works, but suddenly it initializes and starts making the highs from the current candlestick. I am not able to understand why it does it. Capture indicator OK Capture indicator KO

WebRequest cookies problem ... I think

Hi, I am trying to retrieve the calendar from the investing website to show on MT5. void test() { string cookie= NULL ,headers; char post[],result[]; int res; int timeout= 5000 ; string url= " https://sslecal2.investing.com/?columns=exc_currency,exc_importance&amp

ADR Indicator for MT5

Hi, I'm developing this indicator, an ADR for MT5. The algorithm is, get the sum of daily range high and low from last N days (14 in my sample), begining from yesterday, and divide it into N periods (14). Getting the average. I don't know which is the problem but I'm comparing with an MT4 indicator

OnCalculate event doubt

Hi, I am developing an indicator and I don't understand the OnCalculate event at all. From what I can see, this indicator runs every time there is a new tick on the chart. So, I calculate for all candles the indicator (I limit it to 1000 candles) for ( int i = ( int ) MathMax (prev_calculated- 1