Skip to content
Forex Indicator System Thailand
Back to marketplace
UtilityUtility

Ghost SL & TP (hidden stop-loss and take-profit)

A tool that watches price and closes positions itself at a stop-loss or take-profit distance, without sending the levels to the server

Download this EA for free

Download right away. Nothing to fill in.

Version
1.04
Published
11/21/2026
File size
74 KB

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

Version history

  1. 1.04Current11/21/2026 · 74 KB

    First release on this site.

How to use

Attach the EA to a chart and turn on Algo Trading. EnableMonitoringParam defaults to false, so the EA watches nothing until you press the button on the chart panel or set it to true.

SLDistance and TPDistance are in points, 500 each by default. Slippage is the accepted slippage when closing. With AsyncMode on, the EA does not retry a failed close request. Before using it on a live account, check the filters so you know exactly which positions the EA will pick up.

The terminal and the EA must stay running and connected to the internet. If the computer shuts down or the connection drops, no stop-loss protects the positions, so run it on a VPS. DisplayLines shows the SL/TP lines on the chart, with colour and label font options.

Parameters

NameDefaultDescription
BuyRefPricePRICE_BIDPrice compared against the SL/TP levels of buy positions (Bid or Ask).
SellRefPricePRICE_ASKPrice compared against the SL/TP levels of sell positions (Bid or Ask).
SLDistance500Stop-loss distance from the open price in points. 0 = not used.
TPDistance500Take-profit distance from the open price in points. 0 = not used.
Slippage10Maximum accepted slippage when closing, in points.
AsyncModefalsetrue = send close requests asynchronously, without waiting for the result or retrying.
OnlyCurrentSymboltruetrue = manage only positions on the chart's symbol. false = include positions on every symbol in the account.
OnlyTypeAllPosition type to manage: all, buy only or sell only.
UseMagicfalsetrue = manage only positions whose Magic Number matches MagicNumber.
MagicNumber0Magic Number used as a filter (when UseMagic is true). 0 is what manually opened positions carry.
UseCommentfalsetrue = manage only positions whose comment contains CommentFilter.
CommentFilterText that must appear in the position's comment (when UseComment is true).
EnableMonitoringParamfalsetrue = start monitoring as soon as the EA starts. false = wait for the panel button.
EnableNotifyfalsetrue = turn the notification feature on.
SendAlerttruetrue = show a popup alert in the terminal.
SendAppfalsetrue = send a notification to the MetaTrader mobile app (set up your MetaQuotes ID first).
SendEmailfalsetrue = send an email (set up SMTP in the terminal first).
ShowPaneltruetrue = show the control panel on the chart, with a button to switch the EA on and off.
ExpertNameMQLTA-GTPSLPrefix for the names of the panel objects on the chart.
Xoff20Horizontal distance of the panel from the chart corner.
Yoff20Vertical distance of the panel from the chart corner.
ChartCornerCORNER_LEFT_UPPERChart corner where the panel is placed.
FontSize10Font size of the panel.
DisplayLinestruetrue = show the SL and TP lines of each position on the chart.
TPColorclrGreenColour of the TP lines.
SLColorclrSalmonColour of the SL lines.
LabelFontTahomaFont of the line labels.
LabelSize8Font size of the line labels.

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

Ghost SL & TP does not place a stop-loss or take-profit on the broker's server. It watches the price in the terminal and closes the position itself when price reaches SLDistance or TPDistance from the open price (in points). A distance of 0 turns off that side.

You can choose whether to compare Bid or Ask for buy and sell positions separately (by default buys use Bid and sells use Ask). There is an async mode that sends the close request without waiting for the result. SL and TP can be shown as horizontal lines on the chart.

Filters decide which positions are watched by symbol, buy or sell type, Magic Number and comment. There is a panel with a button to start or stop monitoring, and notifications when a position is closed.

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.