Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
Your topic has been moved to the section: Expert Advisors and Automated Trading
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
The topics you linked seem to move in the good direction, but they are MT4 topics or I'm wrong?
Ok, Fernando.
A completely different way to achieve my goal could be as below:
scenario: mt5 running my preferred bot in GBP/USD;
I could add in a chart, say, EUR/USD, an EA that simply close all open positions with the symbol GBP/USD, the one withe bot running in it, based on some rules that it checks on ticks, say balance, equity, et cetera.
Of course, in this way I wouldn't achieve the goal to turn off algotrading, but in the end I need a function to close all the positions in one chart with one bot running on it when some conditions are checked.
Is this way praticable?
Ok, Fernando.
A completely different way to achieve my goal could be as below:
scenario: mt5 running my preferred bot in GBP/USD;
I could add in a chart, say, EUR/USD, an EA that simply close all open positions with the symbol GBP/USD, the one withe bot running in it, based on some rules that it checks on ticks, say balance, equity, et cetera.
Of course, in this way I wouldn't achieve the goal to turn off algotrading, but in the end I need a function to close all the positions in one chart with one bot running on it when some conditions are checked.
Is this way praticable?
Trying to disable/enable the Algo Trading button requires DLL calls and cannot be done in pure MQL.
So, in pure MQL, the easiest way to stop an EA from trading is by removing it from the chart. This can be done by applying a "clean" template onto the chart, or you can also simply close the chart in question.
Obviously any open trades will then have to be closed or managed as well by your "management" program.
The "management" program can be implemented as a "MQL5 Service" that monitors everything and then applies your logic.
Trying to disable/enable the Algo Trading button requires DLL calls and cannot be done in pure MQL.
So, in pure MQL, the easiest way to stop an EA from trading is by removing it from the chart. This can be done by applying a "clean" template onto the chart, or you can also simply close the chart in question.
Obviously any open trades will then have to be closed or managed as well by your "management" program.
The "management" program can be implemented as a "MQL5 Service" that monitors everything and then applies your logic.
It seems that I have to study a bit.
Thank you for your inputs.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- 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!
I'm running a bot that i like very much.
Anyway, would like to know if is it possible to add some general risk management directly in the account, bypassing the single chart with the single ea running in.
From my search, the only way that seems possible is to do sorta of copytrading and add some specific settings.
But it doesn't seem to be the best way to do it.
Best scenario I did imagine is an mt5 account running multiple robots (not ea, where I can add sorta of code I would like) and, maybe, a Python api that close all orders based on a specific percentage of
drawdown, disable algotrading and send maybe a telegram notification.
But, I did understand that it is impossible to enable/disable algotrading with Python.
So, now I think it is not possible to achieve this goal?
Any link or answer will be much appreciated.