Daily Drawdown - MetaTrader 5 Script | Trading Script Download - MT4/MT5 Resources - MetaTrader 5 Resources

In the lower right corner of the page, you can see the profit and loss percentage of your account.

CreateEdit( "Daily DD" , 200 , 68 , 98 , 30 , "Daily DD" , innocent , black , 12 ); CreateEdit( "Daily DDV" , 100 , 68 , 98 , 30 , "" , innocent , black , 12 );
Object delete ( 0 , "Daily DD" ); Object delete ( 0 , "Daily DDV" );
Mql date time w; BuildTime ( timecurrent (),w); String MD = integer to string (w.year) + "." + integer to string (Monday) + ".01" ; Double historical profit = 0 , deposit = 0 ; History selection ( 0 , time current ()); Oolong Ticket_history_deal= 0 ; for ( integer i = 0 ; i < historical transaction total (); i++) if ((ticket_history_deal= Historical transaction to get tickets (1))> 0 ) { Date time time = ( date time ) historical transaction acquisition integer (ticket_history_deal, DEAL_TIME ); if (time> string to time ( string time ( timecurrent (), TIME_DATE ))) if ( historical transaction acquisition integer (ticket_history_deal, transaction type ) == DEAL_TYPE_BUY || historical transaction acquisition integer (ticket_history_deal, transaction type ) == transaction type_sell ) Historical profit + = Double the historical transaction (ticket_history_deal, transaction profit ) + Double the historical transaction (ticket_history_deal, DEAL_COMMISSION ) + Double the historical transaction (ticket_history_deal, transaction exchange ); Other deposits + = double historical transactions (ticket_history_deal, transaction profit ); } Double starting balance = double account information ( account balance ) - historical profit; string text = "" ; Double dd = (historical profit + account information double ( ACCOUNT_PROFIT )) * 100 / starting balance; Text = double to string (dd, 2 ) + “%” ; Object set string ( 0 , "Daily DDV" , OBJPROP_TEXT , text); ChartRedraw ();
Attachment download
📎 daily_drawdown.mq5 (13.12 KB)
Source: MQL5 #41316
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •