Watch how to download trading robots for free
Find us on Telegram!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Experts

Smart Break-Even and Partial Close - R-based trade manager - expert for MetaTrader 5

Deepanshu Goyal
Deepanshu Goyal
  • MQL5 Developer: Expert Advisors, Indicators, Algo Trading Setups at  Freelance
  • India
  • 382
I build Expert Advisors and indicators for MetaTrader 5 that follow your rules exactly, coded cleanly and tested before delivery.
Views:
35
Published:
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

Smart Break-Even & Partial Close manages open positions opened by hand, from the phone app or by other Expert Advisors. It works in R multiples: 1R is the distance between the entry and the original stop loss, remembered the first time a stop is seen.


What it does, in order:

1. Partial close: at InpPartialAtR (default 2R) it closes InpPartialPercent (default 50%) of the volume, once per position. Volume is rounded to the symbol's lot step; if the position is too small to split, the step is skipped.

2. Break-even: at InpBreakEvenAtR (default 1R) the stop moves to entry plus InpBreakEvenOffset points, to cover spread and commission. Trades without a stop loss can use InpBreakEvenPoints instead.

3. Step trailing: from InpTrailStartR the stop trails InpTrailDistance points behind price and only moves in steps of InpTrailStep points.


Inputs:

- InpMagicFilter (-1): magic number to manage; -1 = all positions, 0 = manual trades only.

- InpAllSymbols (true): manage all symbols, or only the chart's symbol.

- InpBreakEvenAtR (1.0), InpBreakEvenPoints (0), InpBreakEvenOffset (20).

- InpPartialAtR (2.0), InpPartialPercent (50).

- InpTrailStartR (2.0), InpTrailDistance (300), InpTrailStep (100).


Design notes:

- A stop is modified only when the new level is better than the current one, and only if it respects the broker's minimum stop distance. This keeps the number of server requests low, which many prop firms check.

- The original risk and the partial-close flag are stored in terminal global variables, so a terminal or VPS restart does not reset the logic. Entries for closed positions are cleaned up every minute.

- Works on hedging and netting accounts and on any symbol and timeframe. Attach it to one chart.

Prop Firm Equity Guard - daily loss and max drawdown protection Prop Firm Equity Guard - daily loss and max drawdown protection

Account-wide protection for prop firm and funded accounts: enforces a daily loss limit and a maximum overall loss (FTMO-style), closes all positions and blocks new trades when a limit is hit, with an optional profit target.

Thanos AI Level Strength Thanos AI Level Strength

Unbroken swing highs and lows, shaded by strength: how old each level is and how many times price was turned away from it.

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

MACD Signals MACD Signals

Indicator edition for new platform.