Richard: I am new to coding and need help to find the highest volume but keeps getting error message "possible loss of data due to type conversion". Can anybody point out where is the mistake and how to correct it?
double hiVolume; int val_index = iHighest(NULL,0,MODE_VOLUME,20,2); if (val_index!=-1) hiVolume = Volume[val_index];
The predefined variable Volume[] is defined as "long", not a "double".
Get into the habit of always checking the documentation when you get Warnings, Errors or in general when coding!
Also, please use the SRC button when adding code to posts.
Volume - Predefined Variables - MQL4 Reference
- docs.mql4.com
Volume - Predefined Variables - MQL4 Reference
Fernando Carreiro:
The predefined variable Volume[] is defined as "long", not a "double".
Get into the habit of always checking the documentation when you get Warnings, Errors or in general when coding!
Also, please use the SRC button when adding code to posts.
Fernando,
Thank you for pointing out my mistakes. I appreciate your help.
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 everybody,
I am new to coding and need help to find the highest volume but keeps getting error message "possible loss of data due to type conversion".
double hiVolume;
int val_index = iHighest(NULL,0,MODE_VOLUME,20,2);
if (val_index!=-1) hiVolume = Volume[val_index];
Can anybody point out where is the mistake and how to correct it?
Thanks a lot.