EA freezes because tickvalue is zero

 
Hi
Seems sometimes my EA freezes because broker returns zero for tickvalue.
Do you have any workaround ?
Ideally the EA shouldn't be slowed down as it id to be fast, it is a newstrader EA.
Thank you!
 
zyrt: Seems sometimes my EA freezes because broker returns zero for tickvalue. Do you have any workaround? Ideally the EA shouldn't be slowed down as it id to be fast, it is a newstrader EA.Thank you!

Then you should have your EA check for that condition. Usually it happens when the connection to the trade server is temporarily lost.

However, there are also certain symbols which have it permanently set that way. Have your EA detect that and warn the user so that they can provide the value manually via an input parameter.

 
There’s no easier way than simply check what is the tickvalue returned by the broker before you use it in the function – then add proper code when tickvalue is proper. If not – just use return or continue – to wait for the tickvalue to be proper value again.
Reason: