Warning: Possible loss of data due to type conversion - in conjunction with array
I found it:
... PosTotal=PositionsTotal(); for ( uint all_positions = 0; all_positions < PosTotal; all_positions++ ) { PosMagic = PositionGetInteger(POSITION_MAGIC); int intPosMagic = (int)PosMagic; TTTradeState[intPosMagic] = 3; }
Inserting line
int intPosMagic = (int)PosMagic;
solved the problem. No more warning.
Hi there,
I'm migrating an expert advisor from MQL4 to MQL5.
In line
I get a warning "Possible loss of data due to type conversion" and I don't know why.
I guess that PosMagic is expected to be datatype integer, but it's ulong. I don't know a way to convert from integer to ulong, so I've got no chance to check if my assumption is right.
Any help would be very welcome.
Best regards
Jorg