Read the docs! Put the cursor on CopyBuffer and press F1 :)
Here you have the alternative from MQ website: https://www.mql5.com/en/docs/series/copybuffer
Do you see the example??
- www.mql5.com
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
Greets,
I've been googling around for a solution to this to no avail. Hopefully someone else has experienced this and knows what the solution is.
So CopyBuffer() expects an int handle as the first argument. This works fine for most indicators, except iVolume() which returns a long. Typecasting should take care of it (as below), but I always get a 4807 error.
Snippet:
The MA handle works just fine. The Volume handle appears to work, returning a value on the iVolume() call, but CopyBuffer() keeps returning a 4807 error, no matter how I try and typecast or use/not use the long type on the Volume variable.
This seems so trivial, but frustratingly I cannot find a solution.
Any ideas?
Thanks
Read the docs! Put the cursor on CopyBuffer and press F1 :)
Here you have the alternative from MQ website: https://www.mql5.com/en/docs/series/copybuffer
Do you see the example??
Thanks for the response!!
Unfortunately, the CopyBuffer doc does not explain what is going wrong, but Dominik's response cleared up my error.
For reference, the solution is to use CopyTickVolume(), which comes from the iVolume() doc page.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Greets,
I've been googling around for a solution to this to no avail. Hopefully someone else has experienced this and knows what the solution is.
So CopyBuffer() expects an int handle as the first argument. This works fine for most indicators, except iVolume() which returns a long. Typecasting should take care of it (as below), but I always get a 4807 error.
Snippet:
The MA handle works just fine. The Volume handle appears to work, returning a value on the iVolume() call, but CopyBuffer() keeps returning a 4807 error, no matter how I try and typecast or use/not use the long type on the Volume variable.
This seems so trivial, but frustratingly I cannot find a solution.
Any ideas?
Thanks