Error code possible loss of data due to type conversion

 

Hi I got this error in mql4 code..can someone help to recitify this?


int ttcx = Time[0] + Period()*60 - TimeCurrent();


error/warning thrown...  possible loss of data due to type conversion


 
Ahmad Fazli Adha Bin Zainol:

int ttcx = Time[0] + Period()*60 - TimeCurrent();

datetime ttcx = Time[0] + Period()*60 - TimeCurrent();

https://docs.mql4.com/basis/types/integer

Type

Size in Bytes

Minimum Value

Maximum Value

C++ Analog

char

1

-128

127

char

uchar

1

0

255

unsigned char, BYTE

bool

1

0(false)

1(true)

bool

short

2

-32 768

32 767

short, wchar_t

ushort

2

0

65 535

unsigned short, WORD

int

4

- 2 147 483 648

2 147 483 647

int

uint

4

0

4 294 967 295

unsigned int, DWORD

color

4

-1

16 777 215

int, COLORREF

long

8

-9 223 372 036 854 775 808

9 223 372 036 854 775 807

__int64

ulong

8

0

18 446 744 073 709 551 615

unsigned __int64

datetime

8

0 (1970.01.01 0:00:00)

32 535 244 799 (3000.12.31 23:59:59)

__time64_t


 
Vladislav Boyko #:

AWesome..thank you.