I wrote an Advisor that closes orders of other advisors working on the account according to the profit-loss criteria and the news feed.
However, to close the orders of the adviser before the release of important news is only half the case.
We still need to stop its work for a given interval before and after.
Using the DLL, You can disable the Autotrading button of the terminal, but I would like to selectively disable the work of a particular expert Advisor.
That is, to get access to the property of the working Advisor Alow Live Trading.
Tell me if someone has already done it.
Thanks.
There are many ways this can be done using time or sleep (which google can be of help as there is alot of ea that does that )
by the way which advisors do you want to stop, the management advisors or the other advisors ?
Hello this is not without danger you can unwillingly create the event where one Expert is continuously opening new orders due to some valid entry rule, while the other Expert is continuously closing these orders due to some valid closing rule.
Protection against these types of runaway events is needed because when such event occurs it has the potential to drain the account in minutes.
Such mistake does only have to be made once.
If you want your experts to communicate with each other you can use global variables of the terminal these can be read and modified / written by Experts see:
https://www.mql5.com/en/docs/globals/globalvariablecheck
Or you could also read and write to a file but that is interval specific so you would be dealing with a slight delay.
In any case you would need access to the source code of both Experts.
- www.mql5.com
Hello this is not without danger you can unwillingly create the event where one Expert is continuously opening new orders due to some valid entry rule, while the other Expert is continuously closing these orders due to some valid closing rule.
Protection against these types of runaway events is needed because when such event occurs it has the potential to drain the account in minutes.
Such mistake does only have to be made once.
If you want your experts to communicate with each other you can use global variables of the terminal these can be read and modified / written by Experts see:
https://www.mql5.com/en/docs/globals/globalvariablecheck
Or you could also read and write to a file but that is interval specific so you would be dealing with a slight delay.
In any case you would need access to the source code of both Experts.
Thanks for the hint, however, the global variables of the terminal are what I created myself, and I need to access the objects created by the terminal. What I can do in the terminal interface having access to the properties of the working expert Advisor and disable its operation, I want to do programmatically. To begin with, it would be nice to create a list of all the advisors working in the terminal.
Ok in that case you could cycle over all open charts, by using the chart_ID and see the expert they are running but it will not be easy to interact with that EA to alter it's trade permissions, if it was not coded specifically to be of a bidirectional type.
The enable / disable auto trading button goes for the terminal and all experts at once, so not one or the other but there are some parameters that relate to the expert's permissions to trade but they appear to be read only.
You can see some examples of this halfway through the page here: https://www.mql5.com/en/docs/runtime/tradepermission
- www.mql5.com
Ok in that case you could cycle over all open charts, by using the chart_ID and see the expert they are running but it will not be easy to interact with that EA to alter it's trade permissions, if it was not coded specifically to be of a bidirectional type.
The enable / disable auto trading button goes for the terminal and all experts at once, so not one or the other but there are some parameters that relate to the expert's permissions to trade but they appear to be read only.
You can see some examples of this halfway through the page here: https://www.mql5.com/en/docs/runtime/tradepermission
- www.mql5.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I wrote an Advisor that closes orders of other advisors working on the account according to the profit-loss criteria and the news feed.
However, to close the orders of the adviser before the release of important news is only half the case.
We still need to stop its work for a given interval before and after.
Using the DLL, You can disable the Autotrading button of the terminal, but I would like to selectively disable the work of a particular expert Advisor.
That is, to get access to the property of the working Advisor Alow Live Trading.
Tell me if someone has already done it.
Thanks.