I manage a number of VPS's with EA's installed on them using. All using the same EA. I come across a problem where some of the EA's will give a 4109 error when trying to open trades. This does not make sense to me as I have allowed live trading in the options and the EA settings, I have AutoTrading on, and I am 100% confident that from an MT4 settings perspective everything should work fine.
I have also contact the brokers where I find this error, and all of them claim it is due to the settings on the MT4 platform. This also does not make sense as all the VPS's I run use the same image, and the same settings for MT4. Most are able to trade without any problems, but some have this issue.
The only thing that I can think of is that I have 2 charts running. On chart 1, I have the actual trading EA. On chart 2, I have another EA, which monitors the activity of chart 1, and if the EA has stopped working, it applies a template to reload the EA on chart 1. This is a fail safe to ensure that i have EA 1 loaded 24/7. This same setup is applied across all MT4's / all VPS's. Is it possible that there is something in the privileges of applying this template that would prevent live trading even if all settings are correct?
Other than this possibility I am completely stumped as to why I would get a 4109 error on some accounts and not others.
Any thoughts or advice would be highly appreciated!
Live trading and DLL imports permissions cannot be extended for the Expert Advisors launched by applying the template using ChartApplyTemplate() function.
If the mql4 program calling ChartApplyTemplate() function has no permission to trade, the Expert Advisor launched via the template will also not be able to trade regardless of the template settings.
If the mql4 program calling ChartApplyTemplate() function has permission to trade, while there is no such permission in the template settings, the Expert Advisor launched via the template will not be able to trade.
So calling ChartApplyTemplate() from a different EA is going to cause a problem then. This should not be the case if I call the function from the EA I want to trade correct?
Hmm yea its strange, The trading EA creates the template (so it should therefore have privileges), and the EA applying the template also as trading privileges. So it doesn't make sense why I would still get a 4109.
Any way to check if a template has trading rights?
Error 4109 because you not enable AutoTrading.
Before apply template file, you must enable AutoTrading, if not, your EA will not "Allow Live Trading".