Skip to content
Forex Indicator System Thailand
Back to marketplace
UtilityUtility

Set Fixed SL and TP EA

Utility EA that sets a fixed stop-loss and take-profit on positions and pending orders matching your filters.

Download this EA for free

Download right away. Nothing to fill in.

Version
1.00
Published
11/21/2026
File size
45 KB

Open source, Apache License 2.0, by EarnForex.com. See licences

Version history

  1. 1.00Current11/21/2026 · 45 KB

    First release on this site.

How to use

Attach it to a chart, enable Algo Trading, set StopLoss/TakeProfit and their types (points or price level), then switch the EA on from the chart panel or set InputEnableExpert to true.

Set CurrentSymbolOnly, OrderTypeFilter, OnlyMagicNumber and OnlyWithComment so only the orders you intend are covered. To change an SL/TP that already exists, turn on OverwriteExistingSL or OverwriteExistingTP.

Parameters

NameDefaultDescription
StopLoss200Stop-loss value; meaning depends on StopLossType: points from the open or current price, or an absolute price level.
StopLossTypeSL_TYPE_POINTSSL_TYPE_POINTS = in points, SL_TYPE_LEVEL = an absolute price, SL_TYPE_UNCHANGED = leave the SL as it is.
OverwriteExistingSLfalsefalse = keep an SL that already exists; true = overwrite it.
TakeProfit400Take-profit value; meaning depends on TakeProfitType: points, an absolute price, or a percentage of the SL distance.
TakeProfitTypeTP_TYPE_POINTSTP_TYPE_POINTS = in points, TP_TYPE_LEVEL = an absolute price, TP_TYPE_PERCENTAGE = percent of the SL distance, TP_TYPE_UNCHANGED = leave the TP as it is.
OverwriteExistingTPfalsefalse = keep a TP that already exists; true = overwrite it.
CurrentSymbolOnlytruetrue = only the chart's symbol; false = every symbol in the account.
OrderTypeFilterALL_ORDERSWhich side to modify: ALL_ORDERS, ONLY_BUY or ONLY_SELL.
OnlyMagicNumberfalsetrue = only modify items whose magic number equals MagicNumber.
MagicNumber0Magic number to filter by (used when OnlyMagicNumber is true).
OnlyWithCommentfalsetrue = only modify items whose comment exactly equals MatchingComment.
MatchingCommentComment text that must match (used when OnlyWithComment is true).
ApplyToPendingfalsetrue = also modify pending orders, not just open positions.
PriceTypePRICE_TYPE_OPENReference price for point-based SL/TP: PRICE_TYPE_OPEN = the trade's open price, PRICE_TYPE_CURRENT = the current price.
ProcessOnceOnlytruetrue = set SL/TP once per position or order.
CheckIntervalSeconds1How often to scan, in seconds.
InputEnableExpertfalseStart with the EA active. Default is false; switch it on from the chart panel or set it to true.
ShowPaneltrueShow the on-chart control panel.
ExpertNameSLTPName used as the prefix of the panel's chart objects.
Xoff20Horizontal offset of the panel, in pixels.
Yoff20Vertical offset of the panel, in pixels.
ChartCornerCORNER_LEFT_UPPERChart corner where the panel is placed.
FontSize10Panel font size.

Defaults are the values shipped with the EA, not a recommendation. Results depend on the market and on each account. Past results do not guarantee future results. Trading carries a high risk of loss.

How to install

  1. Download the .ex5 file.
  2. In MT5, choose File > Open Data Folder.
  3. Copy the file into the MQL5\Experts folder.
  4. Right-click Expert Advisors in the Navigator window and choose Refresh (or restart MT5).
  5. Drag it onto a chart, adjust the Inputs, turn on Allow Algo Trading, then click OK.

Description

This EA never opens orders. It watches open positions (and pending orders if selected) and sets a stop-loss and take-profit from your values: a number of points from the open or current price, an absolute price level, for TP a percentage of the SL distance, or leave the existing value alone.

By default it does not overwrite an SL/TP that is already set, and it handles each position once. It can filter by symbol, Buy/Sell side, magic number and comment. A chart panel turns it on and off, and it scans at the interval you set.

Banners from the Exness partner programme

Exness banner: gold spreads*

FXIDTH is an independent IB partner of Exness. This channel is not owned or operated by Exness.*Spreads may fluctuate and widen due to factors including market volatility, news events, market open/close, and others.*Processing times may vary depending on the chosen payment method.