MT5 research beta · Expert advisor

TF Trade Manager for MT5

Study break-even, closed-bar ATR trailing and optional partial closing for one explicitly selected MT5 position ticket.

MQL5 source, EX5, README and SHA-256 checksums. Research beta.

Concept illustration for TF Trade Manager for MT5; not a software screenshot
Concept illustration; not a software screenshot or a performance result.

What this MT5 EA does

  1. Targets one exact position ticket on the chart symbol.
  2. Stores the original adverse-stop distance locally and measures progress in R.
  3. Proposes a break-even stop and optional closed-bar ATR trail; never deliberately widens an existing stop.
  4. Optional one-time partial close is restricted to hedging demo accounts.

Inputs and default settings

These are the defaults in the supplied source. Review them for your account, exact broker symbol and intended test. They are not optimised trading recommendations.

Inputs in TFTradeManager version 1.0.0-beta1
InputDefault
EnableDemoManagementfalse
TargetPositionTicket0
BreakEvenAtR1
PartialCloseAtR2
PartialClosePercent50
EnablePartialClosefalse
EnableATRTrailtrue
ATRTimeframePERIOD_H1
ATRPeriod14
ATRMultiplier2

Limitations and failure conditions

  • EnableDemoManagement and EnablePartialClose are false by default. All account-changing operations require demo/tester mode.
  • An initial adverse stop is required when original risk is first recorded. Break-even is entry price, not a fee-adjusted break-even.
  • Stored risk and partial-close flags use terminal Global Variables. Use the same terminal and retain those values for an existing ticket.
  • Partial close may not be possible at minimum lot sizes. Netting partial-close operations are intentionally unavailable.
  • Only one manager should control a given position. Network outages, broker rejections and terminal shutdown stop management.

Install in MetaTrader 5

  1. Extract the ZIP and read its README before attaching any file.
  2. In MT5, choose File → Open Data Folder. Copy the MQ5, EX5 and TFCommon.mqh files together into MQL5/Experts/TradeForex.
  3. Refresh Navigator and attach the EA to a chart in an isolated demo or tester. Review its inputs and data requirements.
  4. Use one instance per chart. Reattach after changing accounts; retain the documented state files and settings when testing restarts.

No broker password, web API key or DLL permission is required by this package.

Acceptance checks before relying on it

The following checklist is pending. It is not a report of passed runtime tests.

  • Verify that the wrong ticket and wrong chart symbol are ignored.
  • Check long and short break-even proposals, ATR values and stop/freeze-level rejection on demo.
  • Restart the EA and verify that its original-risk and one-time partial-close state persist.
  • Confirm that disabled management, a real account and an account switch cannot alter positions.

Download contents and integrity

The ZIP contains MQL5 source, the compiled EX5, TFCommon.mqh, README.md, MIT licence, TEST-STATUS.json and SHA256SUMS.txt.

ZIP size: 30,642 bytes. SHA-256: 586728de5613b9adb3d5aba511cbfb2187f1bfcff4657b0855bcbf382cc81c43.

Download EA source and EX5

See how we distinguish compilation, demo testing and trading evidence.

Frequently asked questions

Does this tool work in MT4?

No. This package contains MQL5 source and an EX5 build for MetaTrader 5 desktop. MT4 requires a different codebase; mobile and web charts do not run this desktop file.

What has been tested?

MetaEditor build 6180 compiled the supplied release with zero errors and zero warnings. The runtime acceptance checklist, backtests and forward tests are still pending.

Can it trade on a live account?

Order-changing functions in this release refuse real accounts and are disabled by default. Use an isolated demo or the Strategy Tester. The Execution Logger only records events and never sends orders.

Related tools and guides

Educational research, not personal investment advice. CFDs are leveraged products and can cause rapid losses. A calculation, indicator or stop cannot guarantee an account outcome.