Download MetaTrader 5
To add comments, please log in or register
Any problems with the code? Find solution in documentation!
Expert Invest Software LTD
147
Shimon vaknin 2014.07.31 12:26 

Hi,

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,

Tomer 

Keith Watford
Moderator
8016
Keith Watford 2014.07.31 12:37  

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. 

Expert Invest Software LTD
147
Shimon vaknin 2014.07.31 13:18  

Hi,

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.

 

Thanks,

Tomer 

qjol
3243
qjol 2014.07.31 13:45  
qjol
3243
qjol 2014.07.31 15:10  

hopps just noticed

ExpertInvest:


But I can't edit the other experts,  

you can't remove another expert with ExpertRemove

 
Expert Invest Software LTD
147
Shimon vaknin 2014.07.31 22:09  

SOLVED 

 

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.

 

Thanks anyway,

Tomer. 

whroeder1
13645
whroeder1 2014.08.01 12:10  
ExpertInvest: I would like to know if there is any way to make the trading disable trough the expert advisor?
There was also posting an event method. Don't know if it still works in build 600+. Remove an EA through MQL4 code - MQL4 forum
/
To add comments, please log in or register