TP Manager EA
- Utilità
- HANI MABAD
- Versione: 1.5
- Aggiornato: 23 settembre 2025
- Attivazioni: 5
TP Manager EA (MT4)
A simple, no-nonsense trade assistant that sets Take Profit by money (USD), not by pips.
Tell the EA how many dollars you want to bank per symbol and per direction (Buy/Sell). It reads your current open positions, computes the weighted average price, and moves TP so that when price hits, your net position closes for approximately that USD target. No strategy curve-fitting, no grid, no martingale—just clean TP management.
---
What it does
USD Target TP per Symbol & Direction
Set separate targets for EURUSD Buy, EURUSD Sell, GBPUSD Buy, etc. The EA keeps your TPs in sync with those targets as positions change.
Weighted Average Awareness
If you scale in, it recalculates the average entry and repositions TP accordingly—so your “$5 on EURUSD Buys” still means $5 on the whole net.
Auto-Update (every tick)
With AutoUpdateTP=true, TP is refreshed automatically. Turn it off if you want to manage TPs manually and only update on demand (by toggling true temporarily).
Equity Tools (optional)
MaxEquityLimit: when account equity reaches or exceeds this value, the EA can close all open trades and delete pendings (safety take-profit on the account level).
EquityAlertEnabled (default off): triggers a pop-up alert if equity falls to EquityAlertLevel.
On-Chart Editor
The EA draws simple labels and edit boxes on the chart so you can change USD targets on the fly—no need to reopen Inputs.
Broker Symbol Suffix Support
Use the Suffix input (e.g., "m" for EURUSDm). Set it to "" if your broker has no suffix.
---
Typical use cases
1. Scalping helper – You add or reduce quickly, and let the EA keep the TP at “$5 net” or “$10 net” without doing the math every time.
2. Basket cleanup – Got several buys and sells open on the same symbol? Set a small dollar target per side and let the EA stabilize exits.
3. Account milestone – Use MaxEquityLimit as a “daily goal”: when hit, flatten and lock the gain.
---
Quick start (MT4)
1. Attach the EA to any chart (timeframe doesn’t matter).
2. If your broker uses a suffix, set Suffix (e.g., "m").
3. In Inputs, set your USD targets (e.g., EURUSD_Buy_Target=5, Sell_Target=5, etc.).
4. Leave AutoUpdateTP=true for hands-free updating.
5. (Optional) Set MaxEquityLimit if you want the EA to close everything when equity hits a number.
6. Keep Experts and Journal tabs open the first time to see confirmations or errors.
> Note: The EA manages existing positions; it does not open trades by itself.
---
Inputs (most used)
EnableEA – master on/off.
AutoUpdateTP – auto-reposition TP every tick.
MaxEquityLimit – account-level take-profit; when equity ≥ value ⇒ close all & remove pendings.
EquityAlertEnabled (default false) & EquityAlertLevel – pop-up alert if equity drops to the level.
Per-symbol USD targets:
EURUSD_Buy_Target, EURUSD_Sell_Target, GBPUSD_, USDJPY_, USDCAD_, GBPJPY_, BTCUSD_, XAUUSD_.
UI/Style: FontSize, UI_Offset_X/Y, LabelColor, ButtonBGColor, etc.
Suffix – broker suffix appended to symbol names (e.g., "m").
---
How the TP math works (in plain English)
The EA loops your open orders for a symbol (e.g., EURUSDm), filters by direction (Buys or Sells), and calculates:
Total lots (sum of lots on that side)
Weighted average price (price × lots / total lots)
It asks the terminal for the tick value and computes the price offset that should yield the requested USD target when TP hits.
Then it modifies the TP of all orders on that side to match that net target (within a tiny tolerance to avoid constant rewrites).
---
Practical tips
Set realistic targets. For tiny lot sizes or symbols with small tick value, $20 might be far; start with $2–$10 and build up.
BTC/XAU quirks. Volatile instruments and exotic symbols can have unusual tick values. Watch Experts tab the first time and confirm TPs make sense.
One EA is enough. You can run the EA on one chart to manage multiple symbols—the on-chart editor includes the common majors + BTC/XAU.
Suffix must be correct. If your broker uses EURUSD.m or EURUSD.pro, set Suffix to match (e.g., .m or .pro).
Testing. Always try in demo or small risk first to confirm your broker’s tick value and contract size align with expectations.
---
FAQ
Q: Does this EA open trades?
A: No. It only manages TPs on positions you open manually or with other EAs.
Q: Will it fight with another EA?
A: If another EA keeps modifying TP at the same time, yes. Use only one TP manager per symbol side.
Q: What if there are no open positions?
A: The EA does nothing until there are orders to manage.
Q: Does it set SL?
A: No. It leaves SL unchanged (you can manage SL with another tool if you wish).
Q: Equity alert is ringing on startup—why?
A: By design, EquityAlertEnabled=false. If you enable it and your equity is already below EquityAlertLevel, you’ll get an alert. Raise the level or disable the alert.
---
Compatibility
Platform: MetaTrader 4 (MQ4)
Accounts: Netting/hedging—works with multiple orders per side
Symbols: Any your broker provides; includes targets for EURUSD, GBPUSD, USDJPY, USDCAD, GBPJPY, BTCUSD, XAUUSD by default
Timeframe: Any (not time-based)
---
Change log (public)
v1.0 – Initial release. USD-target TP by symbol & side, editable on chart, optional equity alert (off by default), MaxEquityLimit close-all.
---
Important risk note
This tool does not guarantee profits. It’s a convenience assistant to position your TPs by money targets. Market conditions, broker execution, spreads, symbol specs, and slippage can cause outcomes to deviate from the exact USD amounts. Always test on demo and use responsible risk management.
