I wonder how could it be possible for "MarketInfo(_Symbol,MODE_TICKVALUE)" to be equal to zero?
I've written the code below to calculate the broker's commission in point but sometime it takes the zero divide error !
and then my EA doesn't work anymore.
I'd appreciate if anyone can guide me on this issue.
thanking in advance
Thank you for your prompt response.
I actually use it on the OnTick Func.
what is the solution for this ?
the first solution I found is to use the "while" for checking it but I'm aware if it become an endless loop !
I actually use it on the OnCalculate Func.
Only sometimes as I attach my EA to the chart it takes the zero divide error and the EA won't work anymore, and as I remove the EA and reattach it on the chart it doesn't take the error and the EA can resume its operations.
Add a test on the returned value to avoid "zero divide" error.
The tickvalue is constantly updated by the server and I think it is provided as the last (my guess).
You mean using "Sleep" and "while" together until the MarketInfo(_Symbol,MODE_TICKVALUE) change to non-zero ?
what do you mean by "log it"? could you please describe it a bit more?