fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search

    zero divide in '11872-26913.mq4' (5750,31)

    Questions & Answers
    2
    6
    1697
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      BlueMoon last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • fxDreema
        fxDreema last edited by

        What code do you have around this row?

        B 1 Reply Last reply Reply Quote 0
        • B
          BlueMoon last edited by

          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

          1 Reply Last reply Reply Quote 0
          • B
            BlueMoon @fxDreema last edited by

            @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 here

            static 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;

            1 Reply Last reply Reply Quote 0
            • B
              BlueMoon last edited by

              Bump!
              Really need to fix this problem.

              1 Reply Last reply Reply Quote 0
              • B
                BlueMoon last edited by

                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));

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post

                Online Users

                L
                K
                H
                N

                16
                Online

                146.7k
                Users

                22.4k
                Topics

                122.6k
                Posts

                Powered by NodeBB Forums | Contributors