ATAI Trade Panel
You choose the trade. The panel follows your exit plan.
A free on-chart assistant for placing your own market or pending orders and managing staged exits. Set the lot size, choose an entry, and apply a stop to build a TP1 / TP2 / TP3 plan. It does not generate entry signals or trade automatically on its own.
Download your edition.
A free ATAI account gives you access to these downloads. No purchase is required.
Compiled files · Install in the desktop terminal’s Experts folder · Full settings remain available

- Free · MT5 · no licence key
- Market, limit and stop entry controls
- TP1 and TP2 partial exits
- Protective stop adjustments
- TP3 activates trailing
- Draggable SL and target lines
You stay in control of the entries. Read the management scope and exit behaviour before enabling Algo Trading.
Install on MetaTrader 5
- Download the MT5 .ex5 file below. Sign in to your free ATAI account if asked. No purchase, licence key or source-code compilation is required.
- In the exact MetaTrader terminal you use for this account, choose File → Open Data Folder. Open MQL5 → Experts and copy the .ex5 file into that folder. Do not use MQL4, Indicators or the terminal installation folder.
- Return to MetaTrader. Open Navigator (Ctrl+N), right-click Expert Advisors and choose Refresh. If the tool is missing, restart this terminal and check that you copied the file into its own data folder.
- Open the instrument you want to manage and drag the EA from Navigator onto its chart. The chart timeframe does not set its exit rules. Review Inputs before clicking OK.
- Enable Algo Trading on the terminal toolbar and Allow Algo Trading in the EA’s Common tab. Your account must allow trading; an Investor/read-only login cannot send or modify orders. DLL imports and WebRequest access are not required for this tool.
- Keep MetaTrader open, connected and awake while management is needed. Use separate charts for separate EAs: attaching another EA to the same chart replaces the current one.
Place a trade and build its plan
- Choose volume with the + and − buttons. LOTS shows the actual normalized size; the broker’s minimum lot and lot step still apply.
- For immediate entry, use MARKET BUY or MARKET SELL and confirm. These buttons use the live quote, not the blue action line.
- For a pending entry, click DRAW LINE and drag the blue line to the intended entry. BUY creates a Buy Stop above Ask or a Buy Limit below Ask. SELL creates a Sell Limit above Bid or a Sell Stop below Bid. Confirm the order.
- New orders are submitted without an initial SL or TP. Once a position is open, click DRAW LINE, move the blue line below a buy’s entry or above a sell’s entry, then click SET SL. Confirm the status says SL + TP plan applied.
- SET SL can apply to every eligible position on this symbol that does not already have a plan and for which the line is a valid stop. Positions with their own plan are preserved. A managed position that already has a broker SL can be picked up automatically.
- Review each ticket’s red SL and TP1, TP2 and TP3 lines. To edit an existing plan, drag that ticket’s line rather than repeatedly using SET SL.
Read the buttons
DRAW LINE creates a movable blue action line. BUY and SELL use it for pending orders; they are different from MARKET BUY and MARKET SELL. SET SL uses the line to create an exit plan for eligible open positions.
A pending order placed at the broker remains there if you remove the panel. Manage or cancel it in MetaTrader’s Trade tab. The panel does not add an SL to an unfilled pending order; its exit plan is applied to the open position after a stop is set.
The default exit sequenceClick to view defaults and explanations
| Setting / stage | Default | Meaning |
|---|---|---|
| TP1 | 1R | Close 50% of the original position volume, then request an SL move to entry for the remainder. |
| TP2 | 2R | Close another 25% of the original volume (half the remainder with the defaults), then request an SL move to TP1. |
| TP3 | 3R | Move SL to TP2 and activate trailing on the remainder. TP3 does not automatically close the whole position. |
| After TP3 | 1R trailing distance | The stop follows price at the saved entry-to-SL distance and only moves in the protective direction. Broker minimum stop distances still apply. |
A worked example
Illustration only: a 0.04-lot buy opens at 100.00 with SL at 99.00, so 1R is a price distance of 1.00. Default targets are TP1 101.00, TP2 102.00 and TP3 103.00. At TP1 the panel requests closure of 0.02 lots and moves SL to 100.00. At TP2 it closes 0.01 lots and moves SL to 101.00. The final 0.01 lots enters trailing at TP3.
This example assumes a broker lot step of 0.01. R describes price distance; it is not a fixed amount of account profit. Actual fills, fees and spread affect the realised result.
Small positions and partial closes
The broker must accept both the closing volume and the remaining volume. This version rounds the requested partial close up to a valid lot step. If that would consume the position or leave a remainder smaller than the broker minimum, the panel requests a full close. A 0.01-lot position may therefore close completely at TP1.
Hedging accounts use partial position closes. On netting accounts an opposite deal reduces the single position on the symbol; other trades on that symbol can merge into it, so take particular care with the management scope.
Settings: position selection and volumeClick to view defaults and explanations
| Setting / stage | Default | Meaning |
|---|---|---|
| InpMagicNumber | 26082301 | Identifier assigned to this panel’s orders. It manages positions on the chart symbol with this magic number. |
| InpManageManualTrades | true | Also manage positions on this symbol with magic number 0, normally manual trades. Set false to exclude them. |
| InpDefaultLots | 0.01 | Starting value for LOTS on the panel. It is normalized to the broker’s permitted size. |
| InpLotIncrement | 0.01 | Change applied by each + or − click, subject to broker lot steps. |
| InpDeviationPoints | 20 | Requested execution deviation in broker points, not pips or dollars. It is not a guarantee against slippage. |
| InpConfirmMarketOrders | true | Require a confirmation dialog before a market entry. |
| InpConfirmPendingOrders | true | Require confirmation before a pending entry. |
Settings: targets and partial exitsClick to view defaults and explanations
| Setting / stage | Default | Meaning |
|---|---|---|
| InpTP1_R | 1.0 | TP1 distance as a multiple of the saved entry-to-stop distance. |
| InpTP2_R | 2.0 | TP2 distance in R; must be greater than TP1. |
| InpTP3_R | 3.0 | TP3 distance in R; must be greater than TP2. This is the trailing activation level. |
| InpTP1ClosePercent | 50.0 | Percentage of original volume to close at TP1. |
| InpTP2ClosePercent | 25.0 | Percentage of original volume to close at TP2, not a percentage of the remaining volume. The two percentages must total less than 100; 0 skips that partial close but still allows the stage’s SL adjustment. |
Settings: layoutClick to view defaults and explanations
| Setting / stage | Default | Meaning |
|---|---|---|
| InpPanelX | 12 | Panel inset from the left edge, in pixels. |
| InpPanelY | 8 | Panel inset from the top edge, in pixels. |
| InpPanelWidth | 150 | Width of the panel buttons, in pixels. |
| InpButtonHeight | 28 | Button height in pixels; the panel background adapts. |
Moving lines and keeping management active
Dragging the red SL line requests a broker stop change. A non-zero new entry-to-SL distance recalculates all three targets; moving SL exactly to entry keeps the existing target scale. Dragging an individual TP changes that local target, provided TP1, TP2 and TP3 remain in order beyond entry. Completed partial-exit stages are not restarted by a line edit.
TP targets and partial-exit instructions are managed locally by this EA. The SL becomes a broker-side order only after the broker accepts it. Keep MetaTrader connected and Algo Trading enabled for partial exits and trailing. Removing the EA leaves existing positions, orders and accepted stops at the broker but stops its active management.
Use one manager for each set of positions. ATAI and older branded editions use different saved plan names; do not expect the new edition to import old partial-exit progress. Switch editions while the managed positions are closed.
Troubleshooting
No target lines: the position must be on this chart symbol, match the magic/manual filter and have an SL or receive one with SET SL.
No valid position: the blue stop line may be on the wrong side of entry, the trade may already have a plan, or the position may be outside the selected scope.
Line too close / stop rejected: move the line beyond the broker’s stop/freeze distance and check the Experts log. An order confirmation is not a guarantee of a fill.
TP reached without the expected partial exit: check Algo Trading, trading permissions, connectivity and the broker response. A buy exits using Bid; a sell exits using Ask, which may differ from the candles you are looking at.
The Trade Panel does not require WebRequest access to atai.ca. Do not confuse an internet allowlist setting with permission to trade.