Download MetaTrader 5
To add comments, please log in or register
Have you found an interesting application? Publish it in Code Base - millions of traders will appreciate that!
Azael05x
73
Azael05x 2014.06.27 16:15 
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
73
Azael05x 2014.06.27 16:16  
Of course I could take out #property strict but that's not the solution I'm looking for
whroeder1
13627
whroeder1 2014.06.27 19:22  
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
73
Azael05x 2014.06.27 20:20  

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
28627
Alain Verleyen 2014.06.28 12:29  
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
13627
whroeder1 2014.06.28 12:40  
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