Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Breakout Strategy with Prop Firm Assistance - MetaTrader 5 Expert - MT4/MT5 Resources

author EAcpu | 2 reads | 0 comments |

This is a " simple yet effective breakout strategy ." In this code, I've added some helper functions for the prop company challenge.

Generally speaking, to pass the Prop Company challenge, you need to meet three main criteria:

In this code, I added two functions checking "Target Profit" and "Almost Violated Maximum Daily Loss" to automatically exit all positions and delete all pending orders. Regarding "Maximum Loss", it really depends on your strategy and risk management, so it will not be mentioned in this MQL5 script.

 //+------------------------------------------------------------------+
//|Props company auxiliary function |
//+------------------------------------------------------------------+

// Delete all pending orders and close all positions
Clear all blanks ( string information)
{
comment (message);
for ( integer i = total number of orders () - 1 ; i >= 0 ; i -)
   {
OoLongOrderTickets = OrderGetTickets (i);
if ( orderselect (order-ticket)) 
      {
        Transaction.OrderDelete(orderTicket);
      }
  }

For ( integer i = total number of positions () - 1 ; i >= 0 ; i -)
   {
own_ticket = position_get_ticket (i);
      trade.PositionClose(posTicket);
  }
} // Check if profit target is reached
boolean passed()
{
Return account information double ( account assets ) > PASS_CRITERIA;
} // Check if we are about to violate the maximum daily loss
Boolean value isDailyLimit()
{
Mql datetime datetime;
BuildTime ( timecurrent (), date_time);
Integer current_day = date_time.day, current_month = date_time.mon, current_year = date_time.year;
  
// Current balance double current balance = account information double ( account balance );
  
// Get today's closing transaction PL history selection ( 0 , time current ());
Integer order = historical transaction total ();
  
Double PL= 0.0 ;
order ( integer i = order - 1 ; i >= 0 ; i - )
   {
Own ticket = Historical transaction GetTicket (i);
if (tickets == 0 )
      {
print ( "HistoryDealGetTicket failed, no transaction history" );
rest ;
      }
Double profit = double the historical transaction (ticket, transaction profit );
if (profit!= 0 )
      {
// Get the transaction date and time Mql date time transaction time;
Build Time ( Historical Transaction GetInteger (ticket, DEAL_TIME ), transaction time);
// Check transaction time if (deal_time.day == current_day && deal_time.mon == current_month && deal_time.year == current_year)
        {
            PL+=profit;
        }
Other rest ;
      }
  }
Double starting balance = current balance - PL;
Double current assets = account information double ( account assets );
Return current assets < starting balance - DAILY_LOSS_LIMIT;
}

The parameters we need to specify are:

 Input string DD = "-------------Prop Company Challenge------" ; Input boolean Yes Challenge = False ; Input double pass condition = 110100 .; Input double DAILY_LOSS_LIMIT = 4500 .;

I hope you find value in this script.


Attachment download

📎 propfirmhelper.mq5 (13.32 KB)

Source: MQL5 #49713

Verification code Refresh