TradeKeeper
TradeKeeper is a free position-management Expert Advisor for MetaTrader 5, developed by MQLicense.com. It manages the trades you have already opened — initial protection, breakeven, partial close, trailing stop, and time exit — through one position-management engine. TradeKeeper never opens trades of its own.
Description
1. What TradeKeeper Is and Why It Exists
TradeKeeper is a free position-management Expert Advisor (EA) for MetaTrader 5, developed by MQLicense.com. An EA is a program that runs inside the MetaTrader 5 terminal. TradeKeeper takes over any position you already hold — opened by hand or by another EA — and manages it intelligently.
TradeKeeper handles five protective tasks:
-
Sets an initial stop loss and take profit if you forgot to set them.
-
Moves your stop loss to breakeven (the entry price, where the trade can no longer lose) once the trade is profitable.
-
Closes part of your position at pre-defined profit levels.
-
Trails your stop loss behind price using one of seven methods.
-
Closes positions after a certain time or before the weekend.
TradeKeeper does not open trades, generate signals, or predict the market. The EA is a manager, not a trader. That restraint is exactly what makes it useful for manual traders, prop-firm accounts (firms that fund traders under strict risk rules), and EA-based portfolios.
2. What TradeKeeper Is and What It Is Not
TradeKeeper is a position manager, not a trading robot. The EA manages positions that already exist on your account. Every entry decision stays with you.
The two lists below draw that line clearly. The first list shows what TradeKeeper does. The second shows what it deliberately never does.
Yes: What TradeKeeper is
-
A tool that automatically manages positions that already exist on your account.
-
A safety net for manual trades that you forgot to protect.
-
A consistent enforcer of breakeven, partial closes, and trailing rules.
-
A bridge between your manual entries and institutional-grade trade management.
-
100% free, open-behavior, no license, no DLL, no telemetry.
No: What TradeKeeper is not
-
TradeKeeper does not open new trades.
-
TradeKeeper does not provide entry signals.
-
TradeKeeper does not place pending orders.
-
TradeKeeper does not guarantee profit or prevent loss.
-
TradeKeeper does not replace your trading strategy.
You bring the entries; TradeKeeper manages the exits. That division of labor is the whole tool in one sentence.
3. How to Install TradeKeeper in MetaTrader 5
Installing TradeKeeper takes three steps: copy two files into the MQL5 folders, compile the Expert Advisor, and attach it to a chart. No DLL is required at any step.
The two files are a shared include library and the TradeKeeper source file. One copy of the shared library serves all five products in the MQLicense.com suite.
Step 1 — Copy the Files to the MQL5 Folders
The shared include file is called MQLicense_Common.mqh. The table below shows where each file belongs.
| File | Where to copy |
|---|---|
MQLicense_Common.mqh |
MQL5/Include/ |
TradeKeeper.mq5 |
MQL5/Experts/ |
Note: If you already installed LotSmith and copied
MQLicense_Common.mqhtoMQL5/Include/, you do not need to copy it again.
Step 2 — Compile in MetaEditor (F7)
-
Open MetaEditor (press F4 inside MT5).
-
Open
TradeKeeper.mq5from the Navigator. -
Press F7 (or click the Compile button).
-
Wait for the message: 0 errors, 0 warnings.
Step 3 — Attach TradeKeeper to a Chart
-
In MT5, open any chart. The chart's symbol does not have to match the symbol you want to manage (see the Position Filter section below).
-
From the Navigator panel, drag TradeKeeper onto the chart.
-
Make sure the Algo Trading button in the top toolbar is green.
-
Click OK on the Inputs dialog.
TradeKeeper is now active. The EA picks up any open positions already on your account within one second.
4. First Launch and Recommended Settings
The first launch opens an Inputs dialog with a long list of options. Do not be intimidated. The defaults are tuned for a typical retail trader and work correctly in most situations.
The table below shows the recommended first-time configuration. Every listed value is the factory default, so clicking OK is enough to start.
| Setting | Default | Why |
|---|---|---|
| Apply to | Current symbol | Safest start — only manages the chart you attached to |
| Magic filter | All | Manages both manual trades and other EAs |
| Initial Protection | ON | Fixes unprotected positions after 30 seconds |
| Breakeven | ON | At +1R, moves SL to entry |
| Partial Close | ON | 50% at +1R, 25% at +2R, 25% at +3R |
| Trailing Stop | ON | ATR-based trailing |
| Time Exit | OFF | Enable only if you have a reason |
Click OK. The panel appears on the chart, and TradeKeeper is live.
5. How TradeKeeper Works: Positions, Triggers, and State
TradeKeeper follows one mental model, and the model never changes. The EA checks your positions, acts on reached triggers, and remembers what it has already done. Understanding that loop makes every module below easier to follow.
The loop works in six steps:
1. TradeKeeper looks at all open positions. 2. It filters out any that do not match your filter. 3. For each matching position, it looks up the "state" — has this position already had its breakeven moved? Its partial closed? 4. If not, it checks whether today's price has reached the trigger. 5. If a trigger is reached and the state says it hasn't been done yet, TradeKeeper performs the action and remembers it. 6. It never repeats an action. Even if you restart MT5, the state is preserved, so nothing gets done twice.
The key concept is state. TradeKeeper attaches a small "memory" to every open position: a record of which levels have already fired. The memory survives terminal restarts, chart changes, symbol changes, and even account switches.
TradeKeeper never acts twice on the same level. If the EA moved your SL to breakeven yesterday and you restart the terminal today, it will not touch that SL again.
6. Position Filter: Choosing What TradeKeeper Manages
TradeKeeper can manage every position on your account or only a specific subset. The Position Filter group of inputs controls that choice. Three filters work together: symbol, magic number, and comment.
The symbol filter decides which symbols TradeKeeper manages. The table below lists the three options.
Symbol Filter: Current Symbol, All Symbols, or a Symbol List
| Option | Behavior |
|---|---|
| Current symbol | Only positions on the chart's symbol are managed. Safest option. |
| All symbols | Every position on the account is managed, regardless of symbol. |
| Symbol list | Only the symbols you list (comma-separated) are managed. |
Example: If you want TradeKeeper to manage only EURUSD and XAUUSD but leave everything else alone, choose Symbol list and enter EURUSD,XAUUSD.
Magic Filter: Manual Trades, Specific Magic Numbers, or All
Every trade on an MT5 account carries a magic number: an ID that identifies which program opened it. Manual trades have magic 0. Trades opened by another EA carry that EA's magic.
| Option | Behavior |
|---|---|
| Manual only | Only trades you opened yourself are managed. |
| Specific magic list | Only trades with the listed magic numbers. |
| All | Every trade, regardless of origin (default). |
| All except list | Every trade except those with the listed magic numbers. Useful when you have one EA whose trades you do not want touched. |
Example: You want TradeKeeper to manage everything except the trades from a specific scalping EA whose magic is 998877. Choose All except list and enter 998877.
Comment Filter: Match Positions by Comment Text
The comment filter restricts management to positions whose comment contains a specific text. The filter is useful when your broker adds tags to positions or when another EA writes a recognizable comment.
Leave the comment field empty to disable comment filtering.
7. Module 1 — Initial Protection: Automatic Stop Loss and Take Profit
Initial Protection is the first of TradeKeeper's five modules. The module sets a stop loss, and optionally a take profit, on positions that would otherwise sit unprotected.
By default, TradeKeeper acts only on unprotected positions. If you set your own stop in time, the EA leaves it untouched.
The Problem: Unprotected Positions After Manual Entries
You open a trade from your phone during a busy moment and forget the stop loss. Hours later the market has moved against you, and the position is still naked. The Initial Protection module exists to prevent exactly that scenario.
How Initial Protection Works
TradeKeeper sets a stop loss automatically when a position still has none after a delay you configure. The same applies to a missing take profit if you enable that option. The delay gives you time to set your own SL/TP after opening; inside the window, TradeKeeper will not step on your toes.
Stop-Loss Methods: Fixed Points, ATR-Based, or Percentage of Price
TradeKeeper calculates the automatic stop loss in one of three ways:
-
Fixed points — a fixed distance in points from the entry price. A point is the smallest price step a symbol quotes. Simple and predictable.
-
ATR-based — a distance proportional to the market's average volatility (ATR, Average True Range). The distance adapts to current market conditions.
-
% of price — a percentage distance from the entry price. Useful for stocks and indices.
Take Profit: Optional by Default
TradeKeeper does not set a take profit by default. If you want an automatic target, enable the option and choose a distance in points.
The Overwrite Option: Existing Stops Stay Untouched
TradeKeeper will never overwrite an existing stop loss or take profit by default. If you already set one, the EA leaves it alone. The overwrite option enforces TradeKeeper's own values regardless — use it with care, because it replaces whatever you placed.
The Protection Delay: 30 Seconds by Default
The default delay is 30 seconds. That is enough time for a manual trader to set their own SL/TP right after entry. Reduce the delay to 5 seconds for faster protection, or raise it to 60 seconds if you set your stop manually.
8. Module 2 — Breakeven: Moving the Stop to a No-Loss Level
Breakeven is the second of TradeKeeper's five modules. The module moves your stop loss to a no-loss level once a trade has moved far enough in your favor. A trade that reached profit can then no longer turn into a loser.
Two settings drive the move: the trigger, which decides when it happens, and the offset, which decides where the stop lands. The subsections below cover both, plus spread handling.
The Problem: Winners That Turn Into Losers
A trade goes +50 points in your favor, then reverses and takes out the original stop loss. You had a winner and turned it into a loser. The Breakeven module prevents exactly that by moving your stop to a no-loss level in time.
Trigger Types: Points or R-Multiple
TradeKeeper lets you choose what counts as "far enough":
-
By points — for example, once the trade is +200 points in profit.
-
By R-multiple — for example, once the trade is at +1R (one times the initial risk). This is the professional standard.
Here is the R-multiple in practice. If your SL was 50 points away and the trade has moved 50 points in your favor, it is at +1R. At 100 points of movement, it is at +2R.
The Lock Offset: Lock In a Few Points
Breakeven does not have to mean "exactly at entry price". The offset input decides where the stop lands relative to entry:
-
Offset = 0 points → SL moves to exactly the entry price.
-
Offset = 20 points → SL moves 20 points into profit.
-
Offset = -5 points → SL moves 5 points into loss (rare, but sometimes used to guarantee fills in illiquid markets).
Spread Inclusion: A True Breakeven After Costs
The spread is the small gap between the buy price and the sell price. Enable Include spread to make the offset cover it, so the stop lands at a true breakeven after costs. Most traders should enable it, because spread is a real cost you pay when the SL fires.
Once-Only Execution per Position
The Breakeven module runs exactly once per position. After the move, TradeKeeper never touches that stop again — even if the trade returns to zero and moves up again. The restriction is intentional: it prevents the SL from jumping around and getting you stopped out on a technicality.
9. Module 3 — Partial Close: Scaling Out at Profit Levels
Partial Close is the third of TradeKeeper's five modules. The module closes a percentage of a position at pre-defined profit levels instead of waiting for one full exit.
Traders call this approach scaling out. The subsections below explain the three levels, the defaults, and the volume safety rules.
The Problem: All-or-Nothing Exits
Taking profit all at once is binary: you either get it all or you get nothing. Professional traders scale out instead, closing some at +1R, some at +2R, and letting the rest run. The Partial Close module does this automatically.
Three Independent Levels: Trigger and Percentage
TradeKeeper gives you three independent levels. Each level is defined by two values:
-
A trigger — the R-multiple at which the level fires.
-
A percentage — what percentage of the original volume to close.
The default configuration follows the classic scaling plan:
| Level | Trigger | Close | Meaning |
|---|---|---|---|
| 1 | +1R | 50% | Close half when the trade doubles its risk in profit |
| 2 | +2R | 25% | Close another quarter at +2R |
| 3 | +3R | 25% | Close the remainder at +3R |
TradeKeeper always calculates the percentages against the original volume, not the current volume. The rule prevents compounding reductions (50% of 50% of 50%) and keeps the math consistent.
Breakeven After Level 1
By default, TradeKeeper moves the stop loss to breakeven right after level 1 fires. This is common professional practice: with the stop at breakeven, the worst case is a small win instead of a loss.
Disable the option if you prefer to keep the original stop loss for longer.
Minimum-Lot Protection
Every symbol has a minimum tradeable volume. If a partial close would leave a remainder below that minimum, TradeKeeper closes the entire remaining position instead. The rule prevents the broker from rejecting the partial close, and it prevents you from being stuck with a fraction that cannot be closed.
Once-Only per Level
Each of the three levels fires exactly once per position. Restarting MT5 does not cause them to fire again.
10. Module 4 — Trailing Stop: Seven Modes Explained
Trailing Stop is the fourth of TradeKeeper's five modules. A trailing stop is a stop loss that follows the price automatically as a trade moves into profit.
TradeKeeper offers seven trailing modes, each suited to a different trading style. The subsections below describe every mode and the traders it fits best.
The Problem: Fixed Stops That Give Back Profit
A winning trade can give back all its profit while the stop loss stays fixed. The trailing stop solves this by moving the stop progressively behind the price, locking in more and more profit as the trade advances.
Every mode follows the same safety rules, described at the end of this section.
Mode 1 — Fixed Distance
The stop loss stays a fixed number of points behind the current price. Simple and predictable.
Best for: Scalpers who want a tight, mechanical trail.
Mode 2 — Step Trailing
Like fixed distance, but the stop loss only moves when price has advanced by a full step. The step reduces the number of stop-loss modifications, which lowers the risk of broker rejections.
Best for: Traders on brokers that restrict how often you can modify orders.
Mode 3 — ATR-Based (Default)
The stop loss stays a distance proportional to the current ATR. In volatile markets the trail widens; in quiet markets it tightens.
Best for: Almost everyone. This is the recommended default.
Mode 4 — Candle-Based
The stop loss follows the low of the last N closed candles (for buys) or the high (for sells), plus a small buffer in points.
Best for: Swing traders who want price-action-driven exits.
Mode 5 — Chandelier Exit
The Chandelier Exit is a well-known professional technique. For a buy, the stop loss sits at the highest high of the last N candles minus N × ATR. For a sell, the mirror image applies.
Best for: Trend followers who want to ride long moves while keeping a rational stop.
Mode 6 — Parabolic SAR
The stop loss follows the Parabolic SAR indicator. When SAR flips, the trail flips direction with it. The mode is very responsive but prone to whipsaws in ranging markets.
Best for: Fast-moving markets with strong trends.
Mode 7 — Moving Average
The stop loss sits at a moving average (EMA, SMA, etc.). Trend-followers often use a 50 EMA or 200 EMA on a higher timeframe as a trailing exit.
Best for: Position traders holding over days or weeks.
Safety Features Shared by All Modes
-
Activation threshold — trailing does not begin until the position is a certain distance in profit. Prevents the trail from triggering on tiny moves.
-
Direction-only movement — the stop loss can only move in the profit direction. It never moves against you.
-
Minimum step — the new SL must differ from the current SL by at least a minimum number of points. This avoids micro-adjustments that flood the broker with requests.
-
Minimum interval — a minimum number of seconds between two modifications for the same position. Prevents "too many requests" errors.
-
New-bar-only recalculation — for indicator-based modes (candle, chandelier, PSAR, MA), the SL is recalculated only when a new bar opens. This dramatically reduces CPU usage and API calls.
-
Stops-level and freeze-level respect — TradeKeeper always checks the broker's minimum distance rules before modifying. It will never send an SL that the broker will reject.
11. Module 5 — Time Exit: Closing Positions on a Schedule
Time Exit is the fifth of TradeKeeper's five modules. The module closes managed positions after a set holding time, at a fixed daily hour, or before the weekend.
Each exit works independently, and one shared option can restrict all of them to losing positions. The subsections below describe the three exits.
The Problem: Positions Held Too Long
Some trades should not be held indefinitely. A news-based trade should close before the news cycle ends. A weekend trade should close before the gap. A daily-scalp position should not become a multi-day position by accident.
Three Time-Based Exits
Max hold duration — TradeKeeper closes the position after N minutes have passed since it was opened. For example, set 1440 minutes to close any position after 24 hours.
Close before weekend — on Friday at a specific server time (default 20:00), TradeKeeper closes all managed positions before the market closes for the weekend. This protects you from Sunday-gap risk.
Close at a specific daily time — every day at a fixed hour and minute, TradeKeeper closes all managed positions. The setting suits intraday strategies.
The "Only If Losing" Option
All three modes accept one condition: the position must be in a loss before TradeKeeper closes it. The option is useful when you want to give winners room to run but refuse to hold a losing position overnight.
When to Enable Time Exit
Time Exit is disabled by default. Enable the module only if you have a specific reason. Most manual traders do not want their positions closed on a timer.
12. The R-Multiple Engine
TradeKeeper is built around one core concept: the risk unit R. Understanding it makes the whole product easier to use.
An R-multiple is a profit or loss measured as a multiple of the initial risk. The subsections below define it, justify it, and show how TradeKeeper learns it.
What is R?
TradeKeeper defines R as the "risk unit". One R equals the distance from your entry to your initial stop loss. Every later move is measured as a multiple of that distance.
-
If your entry is 1.1000 and your SL is 1.0950, then R = 50 points.
-
A trade at +1R is 50 points in profit (price = 1.1050).
-
A trade at +2R is 100 points in profit.
-
A trade at -0.5R is 25 points in loss.
Why R matters
Working in R-multiples rather than points lets you apply the same rules to every instrument, timeframe, and account size. A rule like "close 50% at +1R" works on EURUSD and on XAUUSD. It works on a $1,000 account and on a $1,000,000 account, without changing a single number.
How TradeKeeper learns R
TradeKeeper captures three values the moment it first sees a position:
-
The entry price.
-
The current stop loss.
-
The original volume.
The distance between entry and SL becomes R for that position. From that moment, every R-based trigger (breakeven, partial closes) uses this fixed value. The value stays fixed even if you later move the stop loss.
What if the position has no stop loss?
TradeKeeper's Initial Protection module sets a stop loss when a position has none. That SL becomes the R reference. If you disabled Initial Protection or it fails to set one, R-based features (breakeven, partial close) are skipped for that position. The Trailing and Time Exit modules still work, because they do not need R.
State persistence across restarts
TradeKeeper preserves R and all related state across terminal restarts — this is called state persistence. In practice, even if MT5 crashes in the middle of a trade, TradeKeeper picks up exactly where it left off.
13. The Panel
TradeKeeper shows a control panel on the chart while it runs. The panel gives you everything at a glance and lets you intervene quickly.
The subsections below cover the layout, the header, the position table, the module toggles, and the action buttons.
Panel layout
The full panel layout looks like this:
┌────────────────────────────────────────────────────────┐ │ TradeKeeper | MQLicense.com [_] │ ├────────────────────────────────────────────────────────┤ │ Managed: 3 | Floating: +142.50 │ │ Symbol Type Lots R Flags │ │ EURUSD BUY 0.50 +1.42R I B 1 │ │ XAUUSD SELL 0.20 +0.65R I B │ │ GBPUSD BUY 1.00 -0.20R I │ │ -- │ │ -- │ │ -- │ │ -- │ │ -- │ │ │ │ [ INIT ] [ BE ] [ PART ] [ TRAIL ] [ TIME ] │ │ │ │ [ BE Now ] [ Close 50% ] [ Pause All ] │ │ [ Reset States ] [ Cleanup Old ] │ │ MQLicense.com │ └────────────────────────────────────────────────────────┘
Header
The header shows how many positions TradeKeeper is currently managing. It also shows the total floating P/L, the unrealized profit or loss of those open trades.
Position table
The table lists up to eight managed positions, one per row. Each row shows:
-
Symbol — the instrument.
-
Type — BUY or SELL.
-
Lots — current volume.
-
R — how far the trade has moved in R-multiples (positive = profit, negative = loss).
-
Flags — a short string of letters showing which actions have already fired:
-
I = Initial Protection applied
-
B = Breakeven moved
-
1 = Partial level 1 fired
-
2 = Partial level 2 fired
-
3 = Partial level 3 fired
-
Flags I B 1 mean that the initial SL was set, the SL moved to breakeven, and the first partial close executed.
Module toggles
Five buttons at the bottom left switch each module on or off while TradeKeeper runs.
-
Green background = module is active.
-
Red background = module is paused.
Toggling a module off does not affect positions that have already been managed. It only stops future actions from that module.
Action buttons
BE Now moves the stop loss of all managed positions to their entry prices immediately. Use it to lock in breakeven early on all your open trades.
Close 50% closes half of every managed position right now. Use it to de-risk the entire portfolio in one click.
Pause All turns off every module. TradeKeeper stops all automatic management but keeps running and monitoring. Use it when you want a break without uninstalling the EA.
Reset States deletes all remembered state. Every module then re-runs as if TradeKeeper had just started. Use this with care: if you reset while a position is at +2R, TradeKeeper might re-fire level 1 and level 2 partials. This is a power-user tool, and most traders never need it.
Cleanup Old scans the internal state and removes entries for positions that no longer exist. TradeKeeper runs this scan automatically every 10 minutes, but you can force it now.
The panel remembers its position
TradeKeeper remembers the corner you move the panel to. When you restart MT5, the panel returns to the same place.
Minimizing
Click the _ button to minimize the panel. A single line of chart comment with the summary then appears at the top-left of the chart. Click again to restore the panel.
14. Hedging vs Netting Accounts
TradeKeeper works correctly on both MetaTrader 5 account types. A hedging account allows multiple positions in the same symbol, while a netting account merges all trades in one symbol into a single net position. The day-to-day experience differs slightly between the two.
The subsections below describe each account type and help you choose between them.
Hedging accounts
On a hedging account you can hold multiple positions in the same symbol, such as a BUY and a SELL simultaneously, or three separate BUYs. Each position has its own ticket, its own SL, its own TP, and its own state in TradeKeeper.
Result: TradeKeeper manages each position independently. Partial closes are done on the specific ticket. Breakeven is applied per position.
Netting accounts
On a netting account you can only have one net position per symbol. Opening a BUY when you already have a BUY increases the net long. Opening a SELL when you have a BUY reduces or reverses the net position.
Result: TradeKeeper treats the single net position as one unit. Partial closes reduce the net volume. Breakeven moves the SL of the net position.
Because netting accounts merge positions, the concept of "R" is defined once per symbol per position lifetime. If you add to a net position, TradeKeeper keeps the original R reference. It does so because it saw the position first at its original size.
Which account type should you use?
-
Hedging is more flexible and is the standard for retail Forex brokers and prop firms.
-
Netting is required by some brokers and is standard for stocks and some institutional setups.
TradeKeeper does not care which one you have. It detects the account type at startup and adapts.
15. State Persistence and Restarts
TradeKeeper stores its per-position state in MT5's Global Variables, a persistent storage mechanism built into the terminal. This state persistence means the saved data survives interruptions that would normally reset an EA.
The list below shows everything this storage survives:
-
Terminal restarts.
-
Chart changes.
-
Timeframe changes.
-
Symbol changes on the chart.
-
Account switches (state is per account).
-
Windows restarts.
-
MT5 updates.
What is preserved
TradeKeeper preserves the following data for each position:
-
Original volume.
-
R reference (initial risk distance).
-
Initial stop loss.
-
Highest price reached (for trailing calculations).
-
Which levels have fired (breakeven, partial 1/2/3).
-
Last modification timestamp.
-
When the position was first seen by TradeKeeper.
When state is deleted
TradeKeeper removes the stored state automatically in two cases:
-
The position is closed.
-
The cleanup routine runs and finds the position no longer exists.
You can also force cleanup by pressing Cleanup Old on the panel.
The 4-week rule
MT5 Global Variables expire if they are not accessed for 4 consecutive weeks. This matters if a position stays open and untouched for more than 28 days without TradeKeeper running. Its state may then be lost on the next restart.
In practice this almost never happens, because TradeKeeper touches its state on every tick. Just be aware of the rule if you plan to shut down MT5 for a month with open positions.
What happens if state is lost
If state is lost, for example after Reset States or an expired GV, TradeKeeper treats the position as newly discovered. It re-runs Initial Protection, re-detects R, and re-evaluates all triggers.
Partial closes could re-fire after such a reset. If you use Reset States, do it when no positions are open.
16. Common Scenarios
TradeKeeper adapts to many trading styles through its modules and filters. Each scenario below lists one configuration and the result it produces.
Every configuration uses only the input options described in this guide.
Scenario 1 — I manually open trades and forget the SL
Configuration:
-
Initial Protection: ON
-
Delay: 30 seconds
-
SL mode: ATR-based
-
Set SL if missing: ON
-
Set TP if missing: OFF
Result: Any trade you open without an SL gets one within 30 seconds, sized to the current volatility.
Scenario 2 — I want professional scaling out
Configuration:
-
Partial Close: ON
-
Level 1: +1R, 50%, move SL to BE
-
Level 2: +2R, 25%
-
Level 3: +3R, 25%
-
Trailing: ATR
Result: Each winning trade is scaled out at 1R, 2R, and 3R. The SL moves to breakeven after the first partial, and the remainder trails behind the market.
Scenario 3 — I want to protect all my trades before the weekend
Configuration:
-
Time Exit: ON
-
Close before weekend: ON
-
Friday close hour: 20:00 (server time)
-
Only if losing: OFF (close everything)
Result: Every Friday at 20:00 server time, TradeKeeper closes all managed positions before the market closes.
Scenario 4 — I use a specific EA and do not want its trades touched
Configuration:
-
Magic filter: All except list
-
Magic list:
123456(the other EA's magic)
Result: TradeKeeper manages everything except the trades opened by that specific EA.
Scenario 5 — I want a completely hands-off portfolio
Configuration:
-
Symbol filter: All symbols
-
Magic filter: All
-
All five modules: ON
Result: TradeKeeper manages every position on the account, no matter the symbol, no matter the origin. You can close your laptop and come back in a week.
Scenario 6 — I want to temporarily stop management without uninstalling
Use the Pause All button on the panel for this.
Result: All modules are turned off, but TradeKeeper keeps monitoring. When you are ready, click each toggle back to green.
17. Troubleshooting
Most TradeKeeper issues come down to a module toggle, a filter, or a threshold. The checks below resolve the problems traders meet most often.
Each subsection covers one symptom and its most common causes.
The panel does not appear
-
Check that Show Panel is enabled in the inputs.
-
Refresh the chart (press F5).
-
Make sure the chart is not in a state that hides objects (right-click chart → Object List).
Nothing happens when a trade moves into profit
-
Check that the relevant module is ON (green) on the panel.
-
Verify the activation threshold. If you set it to 300 points and the trade has only moved 150 points, no action fires yet — by design.
-
Check the Journal tab in MT5. TradeKeeper writes a log entry every time it takes an action.
-
Verify the position is actually matched by your filter. If the filter says "current symbol" and the trade is on a different symbol, it will not be managed.
My SL was moved when I did not want it to be
-
Check the Breakeven module. If it is ON and your trade hit the trigger, TradeKeeper moved the SL by design.
-
Check the Trailing module. If the trailing was active and the price advanced past the activation threshold, the SL was moved by design.
-
If you want to prevent this, turn off the specific module via the panel toggle.
Partial close did not happen
-
Check that the position's volume is above the minimum lot for the symbol. If the partial close would leave a remainder below the minimum, TradeKeeper closes the whole position instead.
-
Verify the R reference was established. If the position had no SL when TradeKeeper first saw it, R-based modules are skipped.
-
Check the Journal for any modification errors.
"Invalid stops" errors appear in the Journal
The broker rejected the new stop-loss level because it was too close to the current price. TradeKeeper checks the stops level — the minimum stop distance your broker enforces — before every modification, so this should be rare. When it happens, the market usually moved very fast between the calculation and the send. TradeKeeper will retry on the next tick.
State was lost after a long break
MT5 Global Variables expire after 4 weeks of inactivity, as described in the persistence section. If you shut down MT5 for a month, some state may be missing. TradeKeeper then treats the position as newly discovered and re-evaluates all rules.
Fix: Before long shutdowns, close all positions manually or leave MT5 running in the background.
TradeKeeper is slow to react
TradeKeeper processes positions on every tick, throttled to every 200 ms, and on every trade event. Reactions may be slower on a symbol that receives very few ticks, such as an exotic pair at midnight. Switch the chart to a more active symbol if this matters to you.
18. Best Practices
These eight practices follow directly from how TradeKeeper is designed. Apply them from your first demo run onward.
The practices below cover filtering, chart setup, triggers, and testing.
1. Start with the current symbol
Set the filter to Current symbol on your first run. Confirm that TradeKeeper behaves as you expect, then broaden the filter.
2. One EA, one chart
Attach TradeKeeper to a single chart, usually a low-timeframe chart of a symbol that ticks frequently. One instance manages the entire account, so there is no need to run it on multiple charts.
3. Use R-based triggers
Whenever possible, use R-based triggers, such as breakeven at +1R and partials at +1/+2/+3R. R-based rules stay consistent across instruments and account sizes.
4. Enable ATR-based trailing
ATR-based trailing is the most robust default. ATR (Average True Range) adapts to market conditions, so you do not tune parameters per instrument.
5. Keep the minimum interval generous
The minimum interval between modifications (default 30 seconds) protects you from "too many requests" errors. Keep it above 10 seconds unless you have a specific reason.
6. Review the panel every morning
Glance at the panel once a day. The panel shows exactly which positions have had which levels fired. You will notice anything unexpected immediately.
7. Combine with PropGuard
TradeKeeper and PropGuard from the same suite work beautifully together. TradeKeeper manages the trade, and PropGuard protects the account. See the PropGuard guide for setup.
8. Test on demo first
TradeKeeper is 100% free and safe, but always test on a demo account first. Run it on demo for at least a week before going live with real money.
19. Limitations
TradeKeeper is powerful, but it has honest limitations. Know them before you rely on the tool.
Each limitation below describes a boundary of what the EA can see or do.
It does not manage pending orders
TradeKeeper manages only open positions. Pending orders (Buy Limit, Sell Stop, etc.) are ignored, because they have no entry price until they fill.
It cannot see other users' positions
TradeKeeper sees only positions on the currently logged-in account. If you run it on an investor account, it sees only what that account can see.
It cannot manage positions that are already closed
If a position closes between two checks, TradeKeeper does nothing, because the broker already handled it. There is no "undo."
Bar-based trailing modes use the chart timeframe
The candle, chandelier, PSAR (Parabolic SAR), and MA (moving average) trailing modes use the timeframe of the chart they are attached to. If you attach TradeKeeper to an M15 chart, those trails use M15 data. That happens even for a position you intend to hold for weeks. Use a dedicated higher-timeframe chart for long-term positions.
It does not support cross-account management
Each MT5 login is independent. Running three accounts therefore needs three instances of TradeKeeper, one per account.
Netting account partial closes are approximate
On netting accounts, partial closes reduce the net volume. If several overlapping trades merged into one net position, the remembered "original volume" may not match your mental model. That is a characteristic of the netting account type itself, not a bug.
Global Variables expire after 4 weeks of inactivity
See the persistence section above for details. In practice this is not an issue if MT5 runs regularly.
No graphical backtesting of manual entries
TradeKeeper can be tested in the Strategy Tester, but only with trades opened programmatically. If you want to see how it handles manual trades, test on a demo account in real time.
20. Disclaimer
Read this disclaimer before relying on TradeKeeper. It defines what the tool does and what it does not guarantee.
Trading involves substantial risk. This tool is provided free of charge, as-is, without any warranty. Test on a demo account first. MQLicense.com is not responsible for any losses.
TradeKeeper is a risk-management tool. It does not generate signals, does not predict market direction, and does not guarantee profit. The EA executes the rules you configure, no more and no less. The quality of those rules, and of the trades they manage, is entirely your responsibility.
Before using TradeKeeper on a live account:
-
Test it on a demo account for at least one week.
-
Confirm that each module behaves the way you expect.
-
Understand the R-multiple engine and how it uses your initial SL.
-
Read the panel after each significant price move to verify the correct actions fired.
-
Never risk money you cannot afford to lose.
If any of this is unclear, do not use the tool. Read the guide again, experiment on demo, and go live only when you are confident.
Appendix A — Quick Reference Card
The table below condenses the most common TradeKeeper questions into quick answers. Every answer summarizes a rule explained in the sections above.
Use it as a final check before attaching the EA to a live chart.
| Question | Answer |
|---|---|
| Does TradeKeeper open trades? | No. It only manages existing positions. |
| Does it work on Netting accounts? | Yes. Fully supported. |
| Does it need the terminal to be on? | Yes. It runs inside MT5. |
| Does it survive terminal restarts? | Yes. State is preserved. |
| Can it manage trades from other EAs? | Yes, when the magic filter allows it. |
| Can it manage manual trades? | Yes, by default. |
| What if a position has no SL? | Initial Protection sets one. |
| What is R? | The distance from entry to initial SL. |
| What if the broker rejects a modification? | It is logged and retried. |
| How do I stop all management temporarily? | Click Pause All on the panel. |
Appendix B — Glossary
These are the terms TradeKeeper uses throughout this guide.
EA (Expert Advisor) — An automated program running inside MetaTrader.
Magic number — A unique ID attached to trades by an EA. Manual trades have magic 0.
Hedging account — An MT5 account type that allows multiple simultaneous positions in the same symbol.
Netting account — An MT5 account type that merges all trades in the same symbol into a single net position.
R-multiple — The profit or loss of a trade, expressed as a multiple of its initial risk.
SL (Stop Loss) — A price level at which the position is automatically closed to limit loss.
TP (Take Profit) — A price level at which the position is automatically closed to lock in profit.
Trailing stop — A stop loss that moves with the price to lock in profit as a trade advances.
Breakeven — Moving the stop loss to the entry price (or slightly beyond) so a trade cannot lose.
Partial close — Closing only a portion of a position while keeping the rest open.
ATR (Average True Range) — A measure of how much a symbol typically moves in a given time. Used to size stops proportionally to volatility.
PSAR (Parabolic SAR) — An indicator that provides a moving stop-and-reverse level.
Chandelier Exit — A trailing-stop technique based on recent highs/lows and ATR.
End of Guide — TradeKeeper | MQLicense.com
For updates, additional products, and the rest of the risk-management suite, visit MQLicense.com.
Frequently Asked Questions
Is TradeKeeper free to use? +
Does TradeKeeper open trades or only manage existing ones? +
Which modules does TradeKeeper include? +
Does TradeKeeper survive terminal restarts? +
Does TradeKeeper work on hedging and netting accounts? +
Does TradeKeeper run on MT4 or MT5? +
Requirements
TradeKeeper requires MetaTrader 5 to operate. Users must copy specific files into the correct directories and compile the EA using MetaEditor. No additional software or licenses are needed.
Risk Warning
Trading involves substantial risk. This tool is provided free of charge, as-is, without any warranty. Test on a demo account first. MQLicense.com is not responsible for any losses.
Reviews 0
Be the first to share your experience!
Write a Review
🔐 Login to write a review and share your experience.
Login