Download MetaTrader 5

what can cause my variable value to get stucked to a fixed number?

To add comments, please log in or register
Read the interviews of the Automated Trading Championship participants
bobo1974
216
bobo1974 2016.04.07 11:09 

Hi all,

i am using ontick() and i have a calculation to loop all the orders profit for every tick change

it is running fine all the time but some time the value got stuck to a fixed last calculated value

 only by reloading the ea, i will get the value to keep updating again

 

any idea what might cause this? 

edit : for this time i noticed it happened on usdcad only on all 3 different terminals that has the usdcad chart. strange 

Alain Verleyen
Moderator
30742
Alain Verleyen 2016.04.07 11:31  
A bug in your code.
bobo1974
216
bobo1974 2016.04.07 11:46  
Alain Verleyen:
A bug in your code.

 

any idea what kind of bug can caused the caculation to stop or hang?

 because it is normally running perfectly like 99% of the time, just some time it hang 

Daniela Bluemel
586
Daniela Bluemel 2016.04.07 11:50  
alain means you should post your code :D
bobo1974
216
bobo1974 2016.04.07 15:54  
Top-SecreT:
alain means you should post your code :D

i don't think it is my code because it seems the entire ea just stopped working

 maybe mt4 just freezed. i heard of this kind of issue b4 if u open too many terminal at once 

Lorentzos Roussos
9355
Lorentzos Roussos 2016.04.07 17:51  
Are you using a While loop , or calling the OnTimer function ?
bobo1974
216
bobo1974 2016.04.07 17:58  
Lorentzos Roussos:
Are you using a While loop , or calling the OnTimer function ?

no

 

only a few for loop 

Lorentzos Roussos
9355
Lorentzos Roussos 2016.04.07 18:03  
Are you accessing the open trades only?
bobo1974
216
bobo1974 2016.04.07 18:16  
Lorentzos Roussos:
Are you accessing the open trades only?

yes i am looping to find the current profit / loss of open trades with OrderProfit()

 

edit : for this time i noticed it happened on usdcad only on all 3 different terminals that has the usdcad chart. strange  

bobo1974
216
bobo1974 2016.04.08 03:28  
anyone?
Aleksei Beliakov
24282
Aleksei Beliakov 2016.04.08 05:26  
bobo1974:
anyone?
the bug is in your code
To add comments, please log in or register