zero divide in '11872-26913.mq4' (5750,31)
-
Why am I getting this in my logs when I run my script? My script is showing all kinds of inconsistent weird results.
What is happening here? How do I correct this problem?
-
What code do you have around this row?
-
I do not have any custom code. Just using regular blocks.
Based on my reading and research I found out that this could be caused by me trying to divide something by 0 (zero) and since mathematically this returns "infinite", it could cause all issues. But as far as I know I don't think anywhere in my logic...I should come across diving something by "0" The 1 thing I can think of is I obtaining the "Point size" of a market and using that value. But I checked and double checked and triple checked many many ways, that it does successfully return a value which is not zero.Please help me
-
@fxDreema said in zero divide in '11872-26913.mq4' (5750,31):
What code do you have around this row?
I just checked the code as well around this row....Below is what I see.
double VirtualStopsDriver(string _command="", int _ti=0, double _sl=0, double _tp=0, double _slp=0, double _tpp=0)
{
if (!USE_VIRTUAL_STOPS) {return(0);} // Virtual stops are not enabled => stop herestatic ulong mem_to_ti[]; // tickets
static int mem_to[]; // timeouts
static ulong last_checked_ticket=0;static string command; command=_command;
static int ti; ti=_ti;
static double sl; sl=_sl;
static double tp; tp=_tp;
static double slp; slp=_slp;
static double tpp; tpp=_tpp;static int i; i=0;
static int ii; ii=-1;
static int size; size=0;
static int error; error=0;
static int pos;
static int total;
static string name;
static double ask, bid;
static string print; -
Bump!
Really need to fix this problem. -
I wanted to provide more information. I was able to debug this myself and found out exactly which line of code is throwing this error. Here is that line. Can you please help finding out what is happening here? and how I can fix this?
return(CustomPoint(symbol)/MarketInfo(symbol,MODE_POINT));