Hi gooly,
Thanks but IsStopped() doesn't solve the problem, and I don't understand what you mean by "return once and a while" from my loop.. how would I do that?
Hi honest_knave,
Thanks a lot, from what I read setting a timer would be a perfect solution! I was also thinking.. how about running a script on the charts for every currency I need and update the pricing to a common/global variable in the library? Which one would be more economical on the CPU?
Hi gooly,
Thanks but IsStopped() doesn't solve the problem, and I don't understand what you mean by "return once and a while" from my loop.. how would I do that?
It is my experience without IsStopped() I have to kill the terminal to stop the endelss loop (at least in a script). IsStopped() would allow a 'nicer' end.
I have no knowledge about the mt4-internals, but may be within the endless loop more and more memory (just a guess and example) might be allocated (by mt4 not your EA) - a return (as this is the mt4-concept) would allow mt4 to reset in a way..
clausdp:
Hi honest_knave,
.. how about running a script on the charts for every currency ...
I think a script is not the correct idea for what you want, better try it with an indicator? Could be that the access-options of the symbols are different!
BTW can you see the symbols you want in the MarketWatch (enable all symbols!)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi all,
I am trying to write an EA that needs to make calculations using the values of various symbols. The problem I have encountered is that the values of other currencies are updated only when a new tick of the chart symbols comes in, and not every time other currencies change.
To make it clearer, my EA runs on symbol X and it needs the values of currencies Z and Y. The problem is that the values of Z and Y are read only when X changes, whereas if X does not change but Z and Y change the new values of Z and Y will be updated only when a new tick of symbol X comes in.
The solution I thought of was to make the EA run a continuous loop. I'll attach a simple code that show how I was thinking of writing it.
But even with this code the value of EURJPY is updated only when a tick of EURUSD arrives, and not when EURJPY changes. What is wrong with it?
Thanks