how to enable/disable algotrading in a mt5 account running a robot in vps

 

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.

 
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
 
Fernando Carreiro #:
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
Thank you Fernando, I will consider for sure in the future.

The topics you linked seem to move in the good direction, but they are MT4 topics or I'm wrong? 
 
Carmelo Fiorilla #: The topics you linked seem to move in the good direction, but they are MT4 topics or I'm wrong? 

I did not provide the links you see under your post. They are generated automatically by the system, based on your text.


Sometimes they are useful, and sometimes not.
 

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?

 
The best way to fix your issue is to contact the author of the EA and have them implement your required functionality.
 
Carmelo Fiorilla #:

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.

 
Fernando Carreiro #:

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.

Excellent, Fernando.
It seems that I have to study a bit.

Thank you for your inputs.