Skip to content

Integer Types

Integer Types

In MQL4 integers are represented by eleven types. Some types can be used together with other ones, if required by the program logic, but in this case it’s necessary to remember the rules of typecasting.

The table below lists the characteristics of each type. Besides, the last column features a type in C++ corresponding to each type.

TypeSize in BytesMinimum ValueMaximum ValueC++ Analog
char1-128127char
uchar10255unsigned char, BYTE
bool10(false)1(true)bool
short2-32 76832 767short, wchar_t
ushort2065 535unsigned short, WORD
int4- 2 147 483 6482 147 483 647int
uint404 294 967 295unsigned int, DWORD
color4-116 777 215int, COLORREF
long8-9 223 372 036 854 775 8089 223 372 036 854 775 807__int64
ulong8018 446 744 073 709 551 615unsigned __int64
datetime80 (1970.01.01 0:00:00)32 535 244 799 (3000.12.31 23:59:59)__time64_t

Integer type values can also be presented as numeric constants, color literals, date-time literals, character constants and enumerations.

See also

Conversion Functions, Numeric Type Constants

Last updated on