Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

MetaTrader 5 Expert Advisor | Market Capture

Idea by: alex

MQL5 code author: barabashkakvn

Attention: The Expert Advisor is designed for testing in the MetaTrader 5 terminal, not for real trading!

Strategy

  • At the zero bar, it opens SELL #1 at a market price.
  • If the price moves up, it opens a market position BUY #1 at a grid step distance from SELL #1.
  • If the price moves higher, it opens a market position BUY #2 at a grid step distance from the previous BUY #1 position.
  • If the price moves down below the BUY # position level, it opens SELL #2 at a grid step distance, and so on. A similar sequence applies for a downward movement.

Input Parameters

  • Buy trading: true = enabled, false = disabled;
  • Sell trading: true = enabled, false = disabled;
  • Whether to use the function of closing by equity: true, false;
  • Whether to close by equity in drawdown: true, false;
  • Position volume;
  • Take Profit;
  • Distance between positions (minimum);
  • Equity increase percent to close loss-making positions;
  • Equity fall percent to close loss-making positions;
  • Number of loss-making positions to close upon equity growth;
  • Number of loss-making positions to close upon equity fall.

MetaTrader Experts, Indicators, Scripts and Libraries

21563