Integral Constant Overflow

 

What is this error warning ? thanks


 
  1. You multiply five (5) ints together (result is an int,) and then assign it to a long. 2,592,000,000 is more than an int can hold. INT_MAX equals 2,147,483,647.

  2. You won't have a problem if you multiply five (5) longs together.

    long jump=long(60)*60*24*30*1000;
    Print(jump);   // 2592000000
    
  3. Don't post pictures of code, they are generally too hard to read.

    Please edit your (original) post and use the CODE button (or Alt+S)! (For large amounts of code, attach it.)
              General rules and best pratices of the Forum. - General - MQL5 programming forum #25 (2019)
              Forum rules and recommendations - General - MQL5 programming forum (2023)
              Messages Editor

 
William Roeder #:
  1. You multiply five (5) ints together (result is an int,) and then assign it to a long. 2,592,000,000 is more than an int can hold. INT_MAX equals 2,147,483,647.


  2. Don't post pictures of code, they are generally too hard to read.

    Please edit your (original) post and use the CODE button (or Alt+S)! (For large amounts of code, attach it.)
              General rules and best pratices of the Forum. - General - MQL5 programming forum #25 (2019)
              Forum rules and recommendations - General - MQL5 programming forum (2023)
              Messages Editor

I see ,so by default constants are ints if no decimal point and doubles if decimal point . 

Thank you 

(this is the full source code , at first with my error the jump was moving the time to the future)

https://www.mql5.com/en/forum/449798#comment_47801714 

Source of Historical Minute data consistent with MT5
Source of Historical Minute data consistent with MT5
  • 2023.06.28
  • www.mql5.com
Which source of minute data would you recommend to be as consistent as possible with the data on MT5...
 

You can also work around this issue, by using literal suffix to declare a long.

   long jummp  = 60LL*60*24*30*1000;