Forum

Difficulty selecting the right history

Hi all, i'm trying to use today's profit in an EA. What i have done so far works for Deals opened today; double TodaysProfit= 0 ; HistorySelect ((( TimeCurrent ()/ 86400 )* 86400 )+ 28800 , TimeCurrent ()); int total= HistoryDealsTotal (); for ( int i= 1 ;i<total;i++) {

OnTimer problem

Here is the mql4 code (and below it the mql5 code) of an OnTimer function that works well in MT4. It flashes an object and plays a sound for one second when a new bar is created. It also warns me when a Symbol has not had a new tick for two minutes. Have tried to convert the code to mql5 and have

Simple Bar Timer - converting to MQL5 - problem

Hi all, here a very simple Bar Timer that i am trying to convert from MQL4 to MQL5. In Metatrader 4 it works well on all timeframes. The problem - in MT5 it works properly on timeframes below an hour, but anything above an hour it refuses to update. Anybody got an idea of what i may be doing wrong

Critical error Array out of range

Am trying to translate an MQL4 Indicator of mine to MQL5. It loads and initially shows the Indicator lines and arrows correctly, but then refuses to update on new ticks. Debug gives array out of range error on all lines in which arrays use [i-1]. Have also tried [i+1] with the same result