Why coding multiple currency EA is so difficult? And is there a good multiple-currency EA template?

 
I coded one and there there were just so many problems to resolve. I add a Symbol param which is symbols with separator. I made sure to add all the symbols in the market watch. In the code, I waited for 2 minutes when new bar forms to make sure all the symbols receive new bars. But then sometimes the price values are not accurate and what I found out recently is that I have to use refreshRate() and I should handle error properly. It took me a whole week pulling my hair out and it's only working 70%. Is there a template out there I can use?
 
hoangson0403:
I coded one and there there were just so many problems to resolve. I add a Symbol param which is symbols with separator. I made sure to add all the symbols in the market watch. In the code, I waited for 2 minutes when new bar forms to make sure all the symbols receive new bars. But then sometimes the price values are not accurate and what I found out recently is that I have to use refreshRate() and I should handle error properly. It took me a whole week pulling my hair out and it's only working 70%. Is there a template out there I can use?

Its simply very hard even for experienced programmers. Try something simpler.

 
a discussion of coding without code, nice...
 
Another approach to keep symbols updating is to load a very simple (built-in) indicator. This forces the terminal to update the symbol constantly.

You could also build a custom indicator, giving ohlc buffers and use those as a source for your quotes. Here you could place all the code inside the indicator to handle the symbol as required and just load that indicator in your EA with the appropriate parameters for symbol and timeframe.

Also you could add a timestamp buffer (using a union for conversion) to have detailed data about quotes updates.

As an idea.