This one is work, but after target in balance or equity reached,
it not immediately disable expert advisor button, so another EA keep opened trades.
and droneox keep closing another EA trades, so much losing trade made from droneox_equity_guardian.
which are the problem?
int CloseAllTrade()
{
int total=OrdersTotal();
int t;
int cnt=0;
for(cnt=0; cnt<=total; cnt++)
{
bool s=OrderSelect(0,SELECT_BY_POS,MODE_TRADES);
if(OrderType()==OP_BUY)
t=OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_BID),5,Violet);
if(OrderType()==OP_SELL)
t=OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_ASK),5,Violet);
if(OrderType()>OP_SELL) //pending orders
t=OrderDelete(OrderTicket());
}
return(0);
}
Hi guys,
the are any EA to disable expert advisor button when cummulative profit reached?
i found this, but it describe disable expert advisor when equity reach, maybe someone can change it to "when balance is 5000 + xxx" reached so ea will disable expert advisor.
"xxx" amount of money $ xxx that can be input in option ea.
You can add a setting to your EA for the money amount, then call the ExpertRemove function when you want to remove the EA. You could also send yourself a notification just before the expert is removed, so that you would know your profit target is reached. There are some ways to push the button that enables and disables automated trading globally, but I have not tried them.
- docs.mql4.com
You can add a setting to your EA for the money amount, then call the ExpertRemove function when you want to remove the EA. You could also send yourself a notification just before the expert is removed, so that you would know your profit target is reached. There are some ways to push the button that enables and disables automated trading globally, but I have not tried them.
wow thanks!!
- 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 guys,
the are any EA to disable expert advisor button when cummulative profit reached?
i found this, but it describe disable expert advisor when equity reach, maybe someone can change it to "when balance is 5000 + xxx" reached so ea will disable expert advisor.
"xxx" amount of money $ xxx that can be input in option ea.