Among Trailing Equity EA's, as per my experience, Equity Sentry is the best one.
Account equity drops to a certain level (money/percentage/pips)
Account equity reaches a certain level (money/percentage/pips)
Open trades (floating loss/profit) reaches certain level
It will close all running EA's and will shutdown your MT4 terminal (best in case you are copying signals from other traders)
EA can perform several actions on Trigger:
Close open trades
Delete pending orders
Disable Autotrading on MT4 terminal, which makes all EA‘s to stop any operations or simply prevent them from opening, modifying or closing any trades on the account. EA disables Autotrading in a very simple manner by clicking the „Autotrading“ button pro grammatically in the top MT4 toolbar.
Among Trailing Equity EA's, as per my experience, Equity Sentry is the best one.
Account equity drops to a certain level (money/percentage/pips)
Account equity reaches a certain level (money/percentage/pips)
Open trades (floating loss/profit) reaches certain level
It will close all running EA's and will shutdown your MT4 terminal (best in case you are copying signals from other traders)
EA can perform several actions on Trigger:
Close open trades
Delete pending orders
Disable Autotrading on MT4 terminal, which makes all EA‘s to stop any operations or simply prevent them from opening, modifying or closing any trades on the account. EA disables Autotrading in a very simple manner by clicking the „Autotrading“ button pro grammatically in the top MT4 toolbar.
Close MT4 terminal completely.
Kashif Nawaz:
Among Trailing Equity EA's, as per my experience, Equity Sentry is the best one.
Account equity drops to a certain level (money/percentage/pips)
Account equity reaches a certain level (money/percentage/pips)
Open trades (floating loss/profit) reaches certain level
It will close all running EA's and will shutdown your MT4 terminal (best in case you are copying signals from other traders)
EA can perform several actions on Trigger:
Close open trades
Delete pending orders
Disable Autotrading on MT4 terminal, which makes all EA‘s to stop any operations or simply prevent them from opening, modifying or closing any trades on the account. EA disables Autotrading in a very simple manner by clicking the „Autotrading“ button pro grammatically in the top MT4 toolbar.
Close MT4 terminal completely.
This uses the profit loss column. NOT the equity. You can have a loss in the profit column but still have a profit over all between your equity and balance. This does not work for closing $ on equity. Look at your MT4 and see the names for the columns.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Please use Equity Guard. It will serve your purpose here.
Please use Equity Guard. It will serve your purpose here.
//+------------------------------------------------------------------------+
//| Closes everything
//+------------------------------------------------------------------------+
void CloseAll()
{
string symbol = Symbol();
for(int i=OrdersTotal()-1;i>=0;i--)
//for(int ii=0;ii<OrdersTotal();ii++)
{
bool result=false;
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
if((OrderMagicNumber()!=Magicsell || OrderMagicNumber()!=Magicbuy) && OrderSymbol() != symbol) continue;
//double result;
if ( OrderType() == OP_BUY) result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), 5, Red );
if ( OrderType() == OP_SELL) result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), 5, Red );
//if ( OrderType()== OP_BUYSTOP) result = OrderDelete( OrderTicket() );
//if ( OrderType()== OP_SELLSTOP) result = OrderDelete( OrderTicket() );
if(result)i++;
}
return;
}
//+------------------------------------------------------------------+
//| profit/loss open buy |
//+------------------------------------------------------------------+
int profitopenbuy()
{
double totalopenbuy=0;
int i;
for(i=0; i<OrdersTotal(); i++)
{
//double resultsell2=0;
//double resultsell3=0;
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
if(OrderMagicNumber()!=Magicbuy && OrderSymbol() != Symbol()) continue;
//if(OrderProfit()<0) resultsell2 = OrderProfit();
//if(OrderProfit()>0) resultsell3 = OrderProfit();
if (OrderType() == OP_BUY && OrderMagicNumber()==Magicbuy) totalopenbuy = totalopenbuy+OrderProfit();
//if ( OrderType() == OP_SELL && OrderMagicNumber()==Magicsell) totalopenbuy = totalopenbuy+OrderProfit();
//totalsell++; // count if matched
}
return(totalopenbuy);
}
//+------------------------------------------------------------------+
//| profit/loss open sell |
//+------------------------------------------------------------------+
int profitopensell()
{
double totalopensell=0;
//double ticketsell=0;
int i;
for(i=0; i<OrdersTotal(); i++)
{
//double resultsell2=0;
//double resultsell3=0;
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
if(OrderMagicNumber()!=Magicsell && OrderSymbol() != Symbol()) continue;
//if(OrderProfit()<0) resultsell2 = OrderProfit();
//if(OrderProfit()>0) resultsell3 = OrderProfit();
//if ( OrderType() == OP_BUY && OrderMagicNumber()==Magicbuy) totalbuy = (totalbuy+OrderProfit());
if (OrderType() == OP_SELL && OrderMagicNumber()==Magicsell) totalopensell = totalopensell+OrderProfit();
}
return(totalopensell);
}
These functions may help. When your equity is where you want it. You can call a function.
Gordon Gekko:
James:
BUDLogic v1.0:
General rules and best pratices of the Forum. - General - MQL5 programming forum
Among Trailing Equity EA's, as per my experience, Equity Sentry is the best one.
It will close all running EA's and will shutdown your MT4 terminal (best in case you are copying signals from other traders)
EA can perform several actions on Trigger:
Among Trailing Equity EA's, as per my experience, Equity Sentry is the best one.
It will close all running EA's and will shutdown your MT4 terminal (best in case you are copying signals from other traders)
EA can perform several actions on Trigger:
Among Trailing Equity EA's, as per my experience, Equity Sentry is the best one.
It will close all running EA's and will shutdown your MT4 terminal (best in case you are copying signals from other traders)
EA can perform several actions on Trigger:
This uses the profit loss column. NOT the equity. You can have a loss in the profit column but still have a profit over all between your equity and balance. This does not work for closing $ on equity. Look at your MT4 and see the names for the columns.
hello,
i am trying to design an ea. its almost 80 % done. i need someone to complete it for me. i have the files ready.
i need some few adjustments.
COME LETS DO IT TOGETHER....
BELOW IS ITS PERFORMANCE ON TEST.
EMAIL: norgbewisdom@gmai.com