It's an integer.
Keep it to 9 digits or less to avoid problems
-BB-
gordon:
It's an integer.
It's an integer.
this...so the same value range that applies to any other integer. -2147483647 to 2147483647
(2^32)
1005phillip:
this...so the same value range that applies to any other integer. -2147483647 to 2147483647
(2^32)
this...so the same value range that applies to any other integer. -2147483647 to 2147483647
(2^32)
More accurately: -2,147,483,648 to 2,147,483,647
(or generally: -2N−1 to +2N−1-1, in our case N=32).
between 0x00000000 and 0xFFFFFFFF
(while all numbers with the highest bit set to 1 (all those ranging from 0x80000000 to 0xFFFFFFFF) will be interpreted as negative numbers: 0xFFFFFFFF is -1, 0xFFFFFFFE is -2 and so on.)
in other words: you can use anything that fits into a 32 bit signed integer.
Magic number is a ULONG.
ulong #
The ulong type also occupies 8 bytes and can store values from 0 to 18 446 744 073 709 551 615.
![Documentation on MQL5: Language Basics / Data Types / Integer Types / Char, Short, Int and Long Types Documentation on MQL5: Language Basics / Data Types / Integer Types / Char, Short, Int and Long Types](https://c.mql5.com/36/53/documentation-on-mql5-language__3.png)
Documentation on MQL5: Language Basics / Data Types / Integer Types / Char, Short, Int and Long Types
- www.mql5.com
Char, Short, Int and Long Types - Integer Types - Data Types - Language Basics - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
Anyone got the link or know where is the 'official' definition of the minimum and maximum values for the magic number?
I am looking for the 'official' definition.