I would like to know if there is any way to make the trading disable trough the expert advisor?\
What I mean is that I have couple of experts that working in charts, and I want to build another expert advisor that if the account balance/equity is under x value than disable the trading of any other experts in the same account
so, if I has a way to press the auto trading button trough the code it would solve my problem, or any other way that disable trading.
Thanks in advance,
The EA that monitors the balance could write a value to a Global Variable ( of the client terminal). The value would dictate whether trading is allowed or not.
The other EAs could check the GV before trading.
Thanks for your answer,
But I can't edit the other experts, it can be any expert in the world and in my expert I want to limit the trading(disable it) to all of the other working experts when I recognize a specific situation.
hopps just noticed
But I can't edit the other experts,
you can't remove another expert with ExpertRemove
As you said, you can't remove another expert with ExpertRemove(),
But, your answer let me think a little bit of that idea, and I found a way...
there is a function ChartClose(ID) where you can close other charts, and as known, if you close a specific chart you removing the EA inside it.
I ran a loop with ChartFirst() and ChartNext(PrevID) and found each chart except the current and just closed all of them.
To add comments, please log in or register