EA Settings — TradeAdapter Expert Advisor
Order actions (CloseAll, ExitAll) and all EA inputs: API key, TradingView_Symbol, Order_Size, Filling Type, Flip on Close, and more.
Where to change settings #
After attaching the TradeAdapter EA to a chart, double‑click the EA name in the top‑left of the chart (or right‑click the chart → Expert Advisors → Properties). Use the Inputs tab to change the options below. Order actions (CloseAll, ExitAll) are sent from TradingView in the alert message.
Order actions — CloseAll and ExitAll #
These are values you send in the alert message as order_action. They tell the EA to close positions instead of opening a new buy/sell.
| order_action | Effect |
|---|---|
"CloseAll" |
Closes all positions for the symbol on the chart and for the given strategy (the one that sent the alert). Use this when your strategy flattens and you want to close only that strategy’s positions for that symbol. |
"ExitAll" |
Closes all positions for the symbol for all strategies. Use this when you want to flatten the symbol completely, regardless of which strategy opened the trades. |
In your TradingView alert message, set "order_action": "CloseAll" or "order_action": "ExitAll" when the alert condition is meant to close positions (e.g. when your strategy goes flat). Other required fields (e.g. mt_trading_account, platform, ticker) still apply; see TradingView alerts for MetaTrader.
EA inputs (Inputs tab) #
These options appear in the EA settings window when you attach the EA to a chart (double‑click the EA name → Inputs tab). The TradeAdapter API key is required; the rest are optional.
TradeAdapter_API #
Your TradeAdapter API key from the Profile page. Required for the EA to receive and execute alerts.
TradingView_Symbol #
If the symbol you send from TradingView (e.g. {{ticker}}) is different from the symbol on the chart where the EA is attached, put here the symbol that TradingView sends. The EA will then execute on the chart symbol. Leave blank if the alert ticker and the chart symbol match. See Symbol alignment for more.
Order_Size #
Override the order size from the alert. If set, the EA uses this value (in lots) instead of order_contracts from the message. Useful to fix “Invalid volume” errors or to use a fixed lot size.
Order_Size_Adjustment #
Multiplier applied to the order size from the alert (or from Order_Size if set). Use it to scale position size without changing the alert message.
Filling Type (FillingType) #
Order execution (filling) type. Change only if you get an “Invalid order filling type” error from the broker — try IOC first, then other options (FOK, etc.) as allowed by your broker for the symbol.
ConnectionLogDisplay #
When on, the EA shows sync/connection status in the Log tab. Turn off to reduce log output.
Flip on Close #
When true: if the alert sends a SELL that closes a Long position, the EA will also open the corresponding Short position. If the alert sends a BUY that closes a Short position, the EA will open the corresponding Long position. So “close + reverse” is done in one step.
When false: the EA only closes the position; it does not open the opposite side. You need a separate alert/signal to open the new position.
Values: true / false
TradingView Market Position Control #
When true: the EA will close all positions for the symbol when the alert message has Market Position equal to Flat. So when your strategy flattens and TradingView sends market_position: "flat" (or equivalent), the EA closes the open positions for that symbol.
Previously this behavior was on by default. It is now a separate setting so you can turn it off if you prefer to close only via explicit CloseAll or ExitAll alerts.
Values: true / false
DisplayLogs #
When true, the EA writes detailed logs (e.g. to the Experts tab or the chart). Useful for debugging. When false, it reduces log output.
This is the same option as before; it was moved in the inputs list and the values were changed from Yes/No to True/False to match the two settings above.
Values: true / false
Summary #
- Order actions (in alert):
"order_action": "CloseAll"— close all positions for the symbol for the given strategy;"order_action": "ExitAll"— close all for the symbol for all strategies. - TradeAdapter_API — required; your API key from Profile.
- TradingView_Symbol — optional; map TradingView ticker to chart symbol (see Symbol alignment).
- Order_Size — optional; override lot size from the alert.
- Order_Size_Adjustment — optional; multiplier for order size.
- Filling Type — optional; change if you get “Invalid order filling type” (e.g. IOC).
- ConnectionLogDisplay — optional; show or hide sync status in Log.
- Flip on Close — true/false; close + reverse in one step (SELL closes Long and opens Short, etc.).
- TradingView Market Position Control — true/false; when alert has Market Position = Flat, close all positions for the symbol (now optional, was on by default).
- DisplayLogs — true/false; show or hide detailed EA logs.