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.
![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 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