Take Profit

The Take Profit feature closes a position to secure profit when the price moves in your favor. It can be disabled, so a strategy can run without a fixed profit target.

What the feature is for

Use this feature when you want the strategy to close a position automatically once a profit target is reached. The target can be expressed in pips, as a monetary profit, or as a percentage of equity.

Use Take Profit

Adding the feature to the strategy enables it and removing it disables it. When disabled, the feature is removed from the feature list and no profit target is set.

Unit

The unit determines how the take profit value is interpreted:

  • Pips: price distance in pips.
  • Money (account ccy): profit in the account currency.
  • Equity percent: a profit amount derived from current equity when the distance is calculated.

The value range changes with the unit:

  • Pips: 1 to 100,000.
  • Money: 1 to 100,000,000.
  • Equity percent: 0.1 to 100.

Reference

The reference determines the price the take profit distance is measured from:

  • First entry price: measured from the first entry of the position.
  • Average entry price: measured from the average entry price of all fills.
  • Last entry price: measured from the most recent entry.

The reference matters for strategies that add to a position, such as Add on Same Signal, Martingale, or Grid averaging down.

Backtest behaviour

Equity-percent distances use current equity when the initial target is placed and when an applicable add re-anchors it. The placed target stays fixed between those events; it is not continuously moved as equity changes. The MQL5 expert uses the same sampling rules.

Money and equity-percent distances use the base entry volume, before Martingale scaling or position adds, and the account-currency conversion rate at the calculation price. With an Equity percent or Progressive lots Entry amount, that base volume is recalculated too. The realized profit on a scaled or aggregated position can therefore differ from the configured amount or percentage.

The protection reference volume is clamped to the broker's lot limits and rounded to its lot step; this does not change rejection of invalid entry volumes.

The take profit level is anchored to the entry fill price: the bid for long entries, the ask for short entries. The realized profit is the distance to the level minus the spread paid on the close, which is why the pip preview subtracts the spread.

The level is checked inside every bar. When the bar's range reaches the level, the position closes at the level. When a bar opens beyond the level (a gap), the position closes at the bar open. When the Take Profit and the Stop Loss levels are both inside the same bar, the bar is counted as ambiguous and the interpolation method decides which one fills first.

When the position grows (Add on Same Signal, Grid averaging down), the level re-anchors to the reference price: First entry keeps the original level, while Average price and Last entry price move the level with the new fills.

Trade environment preview

The feature shows a preview table that calculates the resulting take profit level in the active account environment.

  • Distance: the configured target distance in its own unit (pips, money, or % of equity).
  • Take Profit: the target amount converted to the account currency, with the percent of the initial account in parentheses.
  • Amount (lots): the entry volume the calculation is based on.

The pip distance subtracts the current spread: the effective profit is the distance to the target minus the spread paid to close the position.

The preview always shows the calculated values for the current settings; it does not depend on the feature toggle. It appears only when a valid trade context is loaded.

Preview figures use the initial account and last close, not live equity.

Example

EURUSD with a USD account, close price 1.08500, initial account 10,000 USD, entry volume 0.01 lots, current spread 1 pip:

UnitTake Profit valueDistanceTake ProfitAmount (lots)
Pips100100 pips9.90 USD (0.10%)0.01
Money (account ccy)500500.00 USD500.00 USD (5.00%)0.01
% of equity3.0%3.00% of equity300.00 USD (3.00%)0.01

With the 100 pips target, the effective distance is 100 pips minus the 1 pip spread: 99 pips × 0.01 lots = 9.90 USD.

Form fields

  • Take Profit: section header.
  • Unit: pips, money, or % of equity.
  • Take Profit: the profit value with range and precision adjusted by unit.
  • Trade environment preview: read-only calculated table.
  • Reference: first entry, average, or last entry price.

Break-even conflict

When both Take Profit and Break-even are enabled, the Break-even activation cannot be larger than the Take Profit: the Take Profit closes the position first, so the activation level is never reached.

  • Same unit: the configured values are compared directly.
  • Different units: the values are converted to money with the trade info calculator, so the comparison needs a loaded trade environment.

When the activation exceeds the Take Profit, the feature list shows the error 'The Break-even activation exceeds the Take Profit'; the Take Profit record is marked with "(Break-even beyond Take Profit)" and the Break-even record with "(Beyond Take Profit)".