fxDreema

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

    Divide by zero coming from iCandleID

    Bug Reports
    2
    2
    463
    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.
    • K
      kroghd last edited by

      Hi,

      Depending on tick data there is a line of code inside iCandleID that can cause a divide by zero problem
      Sometimes I get the start of day candle open value & it will try get candle ID for specific time

      CandleID = (int)MathCeil((double)mins_diff/(double)mins_tf);

      could you consider some protection on this

      if(mins_tf>0){
      CandleID = (int)MathCeil((double)mins_diff/(double)mins_tf);
      }

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

        I did that. Thank you for noticing this bug in the code 🙂

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

        Online Users

        S
        E
        H
        E
        J
        S

        17
        Online

        146.7k
        Users

        22.4k
        Topics

        122.6k
        Posts

        Powered by NodeBB Forums | Contributors