Home System Trading Post

Mastering Pending Orders with Breakdown EA for MetaTrader 5

Attachments
21457.zip (4.42 KB, Download 0 times)

Author of the Idea: arist0

MQL5 Code Author: barabashkakvn

Today, let's dive into the Breakdown EA, a powerful tool designed for trading with pending Buy Stop and Sell Stop orders. Each day, this EA clears out any pending orders left over from the previous day before setting new ones. It strategically places these orders at a minimum distance above the prior day's High and below the Low.

When one of these pending orders gets triggered and starts to show profit, the EA automatically applies a trailing stop to lock in those gains.

It's worth noting that once a pending order is activated, the remaining pending order is removed. This is handled in the OnTradeTransaction function, where it looks for a market entry (DEAL_ENTRY_IN).


Inputs

  • Stop Loss - Set your stop loss level;
  • Take Profit - Define your take profit target;
  • Trailing Stop - Activate trailing stops;
  • Trailing Step - Specify the trailing step;
  • Minimum Distance - Set the minimum distance from the High and Low of the previous day;
  • Risk in Percent for a Deal from Free Margin - Determine your risk per trade;
  • Magic Number - Assign a unique identifier for the EA.

Example: EURUSD, M15:

Breakdown EA in Action

Related Posts

Comments (0)