
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
Big clue was "But i don't know how to do this.".
From the lack of any kind of response from the OP is a indication that there is something wrong. My "guess" is the OP got frustrated from the lack of understanding and abandoned the thread. There was a time years ago when I did the same thing. I learned more from different sites/forums than this one because nobody was taking the time to realize how new I was and continually posted examples and had discussions completely above my understanding at the time.
Form your viewpoint you might be right, on the other hand I have seen many many questions which simply were answered if the just risk a quick look in the documentations and you really feel being a fool answering those questions again and again.
Further there is google and a search option here. If I don't know how to do something this is my next step trying to solve the problem on my own.
In case of the topic of this thread I don't know how to code a multi-currency system I would have answered google or search here for already existing code.
Form your viewpoint you might be right, on the other hand I have seen many many questions which simply were answered if the just risk a quick look in the documentations and you really feel being a fool answering those questions again and again.
Further there is google and a search option here. If I don't know how to do something this is my next step trying to solve the problem on my own.
In case of the topic of this thread I don't know how to code a multi-currency system I would have answered google or search here for already existing code.
Thank you for the feedback, and glad it was positive. lol
I am sorry to whomever is concerned for the way I came across in this situation. I am truly a peace loving drama free kind of person who usually ignores most things I don't agree with.
Hi guys,
Sorry for the long period without activity here. I was traveling to work and also busy with some projects and had to leave the project aside for a while ..
After read the post updates, i have some points to clarify:
Below, the indicator code:
I try to use RefreshRates() but still with the same result... only the pair at the same window works, other pairs not updates.
RefreshRates() has nothing to do with the MqlRates data. WHRoeder's example code is only valid fro the Pre-600 builds. For the latest build, you need to check the various points mentioned in my post, such as testing the return codes of ArrayCopyRates(), as well as the Error codes, size of the Rates Array and as a added precaution pointed out by WHRoeder, the validity of the time attribute.
PS! If you are having difficulty with English, send me a PM. I am Portuguese (Portugal)
Hi guys.
Testing, i included a "recopy" of rates in OnCalculate function... by adding a loop that first FREE the array of pair in all iterations, then copy the rates again. Apears to be working and do not return error.
I don't know if this is the best way to do what i need, but apparently it's working and without erros.
An update to those following this thread!
I have been helping the OP via PM fix his code as he has difficulty with English and we both speak Portuguese. In our testing we came across another "funny" that is happening with the "ArrayCopyRates()" function. When using an MqlRates array with "ArrayCopyRates()" in an EA, the data array is a virtual one that always reports the current status of things, so data is always fresh.
However, in an Indicator, this does not seem to be the case. The array is not a virtual copy but instead a static copy set in time at the moment that the "ArrayCopyRates()" was called. The data does not update when the Symbol is different to the chart symbol. When it is the same symbol as the chart, then the array data is "live" and updates as expected, but when it is of another symbol, it is a static copy.
So, in order for it to work in an Indicator, one must call the"ArrayCopyRates()" function on every call to OnCalculate() event if fresh data is needed.
Hi all.
This is (almost) the same thing i do later, but the difference is i run a ArrayFree before ArrayCopyRates... and i do not make the validations you helped me.
Here the final code that FMIC helped me. It's working normally now in an indicator code..: