Download MetaTrader 5

php isset() equivalent in mql4

To add comments, please log in or register
Azael05x
75
Azael05x  
So I found out that when terminal is saying "Waiting for refresh" (When chart disappears), and is tick, my Expert Advisor is throwing array out of bounds error on Time[0] array. and then EA stops working, so how can I check this array before using it if array exists. who are familiar with php - the function I'm looking for is isset()...
Azael05x
75
Azael05x  
Of course I could take out #property strict but that's not the solution I'm looking for
whroeder1
17116
whroeder1  
Azael05x: So I found out that when terminal is saying "Waiting for refresh" (When chart disappears), and is tick, my Expert Advisor is throwing array out of bounds error on Time[0] array.
Don't look at the predefined variables in OnInit(). Wait for the first tick in OnTick().
Azael05x
75
Azael05x  

damn, of course I'm not doing that.. I'm trying to make access to them from onTick() that's the funny part.

As I said my EA is working fine till that damn moment when chart is disappearing for refresh, then it throws that error on Time[0] variable... how can I avoid that?

Alain Verleyen
Moderator
29868
Alain Verleyen  
Azael05x:

damn, of course I'm not doing that.. I'm trying to make access to them from onTick() that's the funny part.

As I said my EA is working fine till that damn moment when chart is disappearing for refresh, then it throws that error on Time[0] variable... how can I avoid that?

ArraySize() maybe ?
whroeder1
17116
whroeder1  
Azael05x: then it throws that error on Time[0] variable... how can I avoid that?
angevoyageur: ArraySize() maybe ?
If Time[0] throws an error, there's a problem with the terminal. Don't try to band over it. Write the service desk.
To add comments, please log in or register