Close all orders once the drawdown reaches a specific percentage – EA MetaTrader 4

Close all orders once the drawdown reaches a specific percentage - expert for MetaTrader 4
This code has some functions to close all opened orders once the drawdown reaches a specific percentage of the account balance. You will just enter the magic number of the orders (enter 0 for control all orders), and the maximum percentage of drawdown that will allow the code logic to close the order once it … Read more

daily drawdown – indicator MetaTrader 5

daily drawdown - indicator for MetaTrader 5
In the lower right corner of the page, you can see the profit or loss percentage of your account. OnInit():    CreateEdit(“Daily DD”,200,68,98,30,”Daily DD”,clrWhite,clrBlack,12);    CreateEdit(“Daily DD V”,100,68,98,30,””,clrWhite,clrBlack,12); OnDeinit:    ObjectDelete(0,”Daily DD”);    ObjectDelete(0,”Daily DD V”); OnCalculate:    MqlDateTime w;    TimeToStruct(TimeCurrent(),w);    string md=IntegerToString(w.year)+”.”+IntegerToString(w.mon)+”.01″;    double historyProfit=0,deposit=0;    HistorySelect(0,TimeCurrent());    ulong ticket_history_deal=0;    for(int … Read more

Current Relative Drawdown – EA MetaTrader 5

Current Relative Drawdown - expert for MetaTrader 5
The DD_Relative function calculates the relative profit or loss (drawdown) of the current trading account in percentage. To do this, it uses the Current_LossOrProfit() function to get the current profit or loss of all open positions and then divides it by the current account balance obtained via the AccountInfoDouble(ACCOUNT_BALANCE) function. After calculating the relative gain … Read more