It isn't an error. It's just a warning.
I think this topic helps you
double normMe(string ins,double price) { int dig=(int)SymbolInfoInteger(ins,SYMBOL_DIGITS); return(NormalizeDouble(price,dig)); }
Yes, i read 70-80% before, thats how I know to do that thing (int)...
int dig=(int)SymbolInfoInteger(ins,SYMBOL_DIGITS);
Thanks for letting me know its not error. Its a huge relief to me. This topic is solved, thanks to your reply.
Very old topic but still some questions.
I type :
a)
int sum; sum = (int) iVolume(NULL,0,0);
With (int) I prevent the "possible loss of data due to type conversion". The data type of iVolume is long and therefore takes 8 byte. Does this operation cause it to take only 4 bytes? Or does this additional code (int) increase the memory size. In other words which of these has the best performance: a) or b)?
b)
int sum; sum = iVolume(NULL,0,0);
There is no difference between a) and b) except for the compiler warning.
'sum' remains an int; it can't change.
The compiler is warning you that the long value from iVolume will be put into an int, as there is no other choice. It warns you because you haven't explicitly asked for this to happen (but it is going to happen nevertheless).
By typecasting, you are instructing it to put the long value into an int. As you have done this explicitly, there is no need for the warning.
HTH
Very old topic but still some questions.
I type :
a)
With (int) I prevent the "possible loss of data due to type conversion". The data type of iVolume is long and therefore takes 8 byte. Does this operation cause it to take only 4 bytes? Or does this additional code (int) increase the memory size. In other words which of these has the best performance: a) or b)?
b)
Thank you very much.
How to fix this?
ObjectSetString (0, "SPREAD", OBJPROP_TEXT, IntegerToString(MarketInfo(NULL, MODE_SPREAD)));
MODE_SPREAD is in int.
OBJPROP_TEXT must be string.
Why IntegerToString doesnt work smoothly ?
How to fix this?
MODE_SPREAD is in int.
OBJPROP_TEXT must be string.
Why IntegerToString doesnt work smoothly ?
Try DoubleToString. MarketInfo returns a double.
Try DoubleToString. MarketInfo returns a double.
CopyBuffer(AlligatorDefinition,2,0,3,LipsArray);
possible loss of data due to type conversion
CopyBuffer(AlligatorDefinition,2,0,3,LipsArray);
possible loss of data due to type conversion
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I have written this small function which helps any programs to do the normalize of prices (without having to re-type the long normalize command), but it keeps giving this error. How can i solve this?
the error is: possible loss of data due to type conversion tstEA.mq5 78 12
if theres any suggestion or work around to this? Thx!
Update: Now I do this (as below), and the error disappears!!. but is my solution below ok? Will it have any effects later, is what i am worried....