- Instead of CopyRates and then copying the open you could just use CopyOpen - MQL4 Documentation
int z = sizeof(p); for (int i=0; i<=z; ++i)
This means you access one past the end.for (int i=0;i<=(copied-1);i++) for (int i=0;i< copied ;i++) // Use the C style [0 .. N)
- How can sizeof(p) possibly work? It's a compile time statement; pass the length.
WHRoeder:
Thanks for the above WHRoeder. I have made the relevant adjustment however, even by explicitly setting the length in the C function, this doesn't work. It appears that this is looping through a count to 100 (array size) and the output is coming out 100. I am sure that Copyrates holds values cause I run stop checks with Mqlrates Open.
- Instead of CopyRates and then copying the open you could just use CopyOpen - MQL4 Documentation
- This means you access one past the end.
- How can sizeof(p) possibly work? It's a compile time statement; pass the length.
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 Guys,
I am parsing a series of rates and then copying the .Open part into a new array, this is done via:
The idea now is to pass the entire copyrates array into a C++ program complied as a .dll. The C++ routine is simple and is just generating the sum of the components of the array. This is how I have implement it:
I then declare the function at the Import section of the MQL code via:
and then try to call it (and there is the problem) via:
The result I am getting is:
The sum is: 5.0
Anyone has any idea what is going on here?
Many thanks for the interest Guys!