METATRADER TO DXTRADE TRADE COPIER - API APPROACH


User Guide: MT4/MT5 to DxTrade Trade Copier EA


API Method






Please review these three limitations before using the copier:


(a) To copy TP/SL modifications, the initial TP/SL levels must be included with the market order. Enable TP/SL copying in the Copier EA settings.


(b) This Copier EA uses the DxTrade API. Some brokers block API access, so check with your broker before renting or purchasing it.


(c) DxTrade imposes request rate limits and throttling rules. The copier follows these rules by default, but includes an option to send requests simultaneously.

Rate Limits & Throttling

The DXtrade REST API supports configurable request rate limits for each client. There are four types of limits:

  • Login requests: one request per second per IP address by default.
  • Data retrieval requests: two requests per second per client session by default.
  • Placing, modifying, or canceling orders is limited to one request per second per client session by default.
  • Large data requests, such as retrieving all portfolios for all accounts: each resource available to the client can be accessed no more than once per second by default.

If the limit is exceeded, the server returns 429 Too Many Requests.


These limits affect copying as follows:

- Trading requests must be sent at least one second apart. Simultaneous requests for multiple accounts are therefore sent in sequence, with a one-second interval.

- Login requests are also limited to one per second. If you attach the copier to two charts, both may attempt to log in when MT4 restarts, which can cause login failures.


If an order fails to open or close, check the API responses in the MT4/MT5 log. A response may look like this: {"orderId":381975072}


To reconnect the copier to the broker server, change the copier chart's timeframe.



Installation


1. Install the MT4 or MT5 Copier EA.

Copy "MT4ToDxTrade.ex4" or "MT5ToDxTrade.ex5" into the \MQL4\Experts\ or \MQL5\Experts\ folder, respectively.


In MT4 or MT5, go to Tools > Options and enable "Allow DLL imports" in the settings shown below. The EA requires network access for license authentication.




Open any chart and attach the Copier EA. Enter your license key in the first EA input.



Attach the Signal EA to only one chart per destination account.

The EA receives signals for multiple symbols and trade events from this MT4/MT5 account. To copy to a different DxTrade account, attach another instance to a separate chart.


To pause the EA, click "Stop Signals" on the trade panel. The MT4/MT5 "AutoTrading" or "Algo Trading" button does not pause this EA, because it does not place trades in MetaTrader.



2. Use the following details to log in to the DxTrade API. These are the details you provided or received when registering. Check your broker welcome email.


(a) Username

(b) Password

(c) Broker server URL - for example:

https://demo.dx.trade

or

https://dxtrade.alphacapitalgroup.uk

or

https://trade.brightfunded.com


You can leave the "Account Ids" field blank. Your account name or number is shown in the upper-right corner of webtrader after you log in. If this field is blank, the copier retrieves all available account numbers from your DxTrade broker and uses the first one for copying trades.


To specify which DxTrade accounts should receive copied trades, use the following format:

For one account:

cfd_23vg91

For multiple accounts:

cfd_ytyaT2,cfd_plTh96 

(separate account names with commas)


- Include only accounts of the same type, such as CFD, Crypto, or Stock, in one Copier EA instance.


- If you enter multiple accounts, the EA sends the copy signal to each one. Important: Enter no more than three accounts in this list. To copy to more accounts, open another chart and attach the copier with a different account list.


The copier checks the account number you enter against the account numbers returned by DxTrade. If the number does not match, the EA pauses.


3. Symbol mapping list - If instrument names differ between MetaTrader and DxTrade, enter the MT4/MT5 symbol, followed by a comma, the DxTrade symbol, and a semicolon.

BTCUSD,BITCOIN;

For two symbol mappings, enter:

BTCUSD,BITCOIN;XAUUSD,GOLD;


- 'MetaTrader Symbol Prefix To Be Ignored' and 'MetaTrader Symbol Postfix To Be Ignored'

For example, if you enter "en" as the prefix and the MT4/MT5 symbol is enEURUSD, the Copier EA removes "en" and sends EURUSD to DxTrade.

For example, if you enter ".st" as the postfix and the MT4/MT5 symbol is EURUSD.st, the Copier EA removes ".st" and sends EURUSD to DxTrade.


- Add Extra Symbol Postfix To DxTrade

This setting adds the same postfix to every symbol sent to DxTrade. For example, entering ".PRO" converts EURUSD to EURUSD.PRO and GBPUSD to GBPUSD.PRO, so you do not need to map each symbol separately in "Symbol Mapping List".


The EA automatically adds the slash used in DxTrade symbols such as EUR/USD. You do not need to map EURUSD to EUR/USD manually.


4. Lot multiplier list - To multiply lot sizes when copying to DxTrade, enter a value such as:

EURUSD,10;XAUUSD,2;

To apply the same multiplier to all trades, simply enter:

10

All MT4/MT5 trade lot sizes will then be multiplied by 10.


5. TP/SL price copying is enabled by default. You can disable it if you do not need this feature.

Even when TP/SL prices are not copied, the copier sends a close signal to DxTrade when an MT4/MT5 order closes.


Copy Limit/Stop Orders is disabled by default.


No Close Signals If That Dealt Order Has TP/SL Prices  - If TP/SL copying is enabled, we recommend enabling this option. It prevents the copier from sending an MT4/MT5 exit signal when the DxTrade trade already has its own TP/SL levels.


Partial close is enabled by default.


6. Lot mode - The default is "follow MT4/MT5 order lot". The other options are "Equity-To-Equity" and "Fixed Lot".


7. Order magic number list - Specify which magic numbers to include when copying trades.


Separate multiple magic numbers with commas.

For example: 3413434,1343292

Leave this field blank (the default) to include all trades.


Important:

To copy only trades from your EA, enter its magic number. For example, enter 3421243.

The MT4/MT5 Signal EA will then scan only orders with magic number 3421243.

Manual MT4/MT5 orders have a magic number of 0.

To copy both manual orders and orders from your EA, enter:

0,3421243

Include 0 in the magic number list to copy manual orders.


8. Applicable symbol list - Limit copying to specific symbols or instruments. Separate them with commas, for example: EURUSD,XAUUSD,USOIL.

Leave this field blank (the default) to include all symbols.


9. Applicable comment list - Limit copying to orders with specific comments. Separate multiple comments with commas.


> Reverse trade - When set to true, this reverses the trade signal sent to DxTrade.

For example, a LONG trade will be sent as a SHORT trade.


10. "API Network Throttling?" is enabled by default to comply with DxTrade API limits. You can disable it if required.


11. The copier supports custom control and filtering rules through the following method.


If you enable "Enable Hold-Up Feature?" (default: false), the MT4/MT5 Signal EA checks whether the MT4/MT5 global variable named

DXCOPYDISABLE

is set to 1. If it is, the Signal EA pauses. If it has any other value or is not set, the Signal EA continues running.


You can write an EA or indicator yourself, or hire a developer to create one, to set this global variable according to your own control or filtering rules.


=====


Special Notes: Copying to Multiple Accounts


1. Using the DxTrade API version:

You can copy to multiple accounts with the same prop firm.

Open multiple charts and attach the Copier EA to each one with a different account ID.

However, DxTrade imposes throttling limits on requests from the same client IP address. Test this setup to check whether simultaneous requests are rejected.

Alternatively, attach one Copier EA to one chart and enter multiple accounts in "Account Ids". This approach handles throttling but increases copying latency. See the "Account Ids" instructions above.


2. Using the DxTrade non-API version:

DxBridge works by simulating DxTrade webtrader activity.

DxTrade webtrader allows only one account to operate under a single prop firm username. You cannot place orders on multiple accounts simultaneously in the same webtrader session.

Note: "Username" is the first field on the DxTrade webtrader login page.

If you have multiple accounts under one username, select the account you want to copy to in webtrader before starting DxBridge.

Only one DxBridge instance can run on a computer or VPS.

One DxBridge app supports multiple non-API Copier EAs and destination accounts, provided each account uses a different username.

Add a separate login= line for each username in config.ini. Save the file and restart DxBridge whenever you change it.

For example:

login=username1,password1,https://dxtrade.ftmo.com/
login=username2,password2,https://dxtrade.ftmo.com/
login=username3,password3,https://webtrader.myfundedfx.com/


=====


Special Notes: DxTrade/TradeLocker Network Throttling


Network throttling can affect strategies that generate simultaneous trade actions or copy to multiple accounts. The following explains how these limits work and how the copier handles them.


- What is network throttling? 


Network throttling limits how often a client can send requests to a server. Trading API providers use it to prevent simultaneous requests from overloading their servers.


- How do DxTrade and TradeLocker apply these limits?


DxTrade describes its throttling rules in the API documentation:

https://demo.dx.trade/developers/#/DXtrade-REST-API

(see the "Rate Limits & Throttling" section)

TradeLocker does not describe these limits in its API documentation, but our testing has shown similar behavior, with somewhat less restrictive limits than DxTrade. When trading requests arrive simultaneously, the TradeLocker API may reject some with a "too frequent requests" response.


DxTrade applies throttling to logins, data retrieval, trading requests, and other API calls. For trading requests, the rule is:

Placing, modifying, or canceling orders is limited to one request per second per client session by default.

If you send three order entries, exits, or modifications to the DxTrade API within one second, it accepts the first and rejects the others with a "too many requests" response.


Copying to multiple accounts can also produce simultaneous requests, because the copier sends trade actions for each destination account.



- How does the copier handle DxTrade/TradeLocker network throttling?


All API responses, whether successful or failed, appear in the MT4/MT5 log. If an order fails to open or close on DxTrade or TradeLocker, check the log for an API error response.


The copier cannot change the platform limits. You can adjust the following options at the bottom of the copier input settings:


(a) 'API Network Throttling?' - Enabled by default (true). The copier spaces requests to comply with API throttling limits.


(b) 'Throttling Delay in Second' - The default is 1 second. This setting does not apply when "API Network Throttling?" is false.


To test without throttling, set "API Network Throttling?" to false (disabled). The copier will send simultaneous entries, exits, and modifications immediately to the API server.


To test this, use the MT4/MT5 one-click panel to place several orders quickly, or close several orders at once. Check the API responses in the MT4/MT5 log. If the platform accepts these requests, or your strategy does not generate simultaneous trade actions, you may choose to leave this option disabled.


With "API Network Throttling?" enabled (the default), three simultaneous order entries are processed in sequence:


- Send the first entry request to the API and queue the remaining two.

- Wait 1-2 seconds, depending on your throttling delay setting and a small timing margin.

- Send the second entry request.

- Wait another 1-2 seconds.

- Send the third entry request.

The entire process must complete within 30 seconds.


Suggestions:


(a) Review whether these delays affect your strategy.

(b) Ask your broker whether it can relax the throttling limits for your account. An exception may not be available.


=====


- Alert Notifications


The signal EA provides four alert notification options:


- Popup Alert

- Sound Alert

- Mail Alert

- Mobile Alert


'Popup Alert' is enabled by default.


To receive email or mobile notifications, you must not only enable the corresponding 'Mail Alert' or 'Mobile Alert' option, but also configure MT4/MT5 to send notifications to your email address or the MT4/MT5 mobile app.


For instructions on configuring email or mobile notifications in MT4/MT5, you can consult an AI assistant such as ChatGPT or Claude.


- Notification History


Regardless of which alert options are enabled, all notification messages are recorded in the MT4/MT5 'Experts' log panel.


You can view recent messages directly in the 'Experts' tab. To access historical logs, right-click within the 'Experts' tab and select 'Open', then locate and open the log file for the desired date.




Popular posts from this blog

TRADE COPIER USER GUIDE LIST

FREE EVALUATION WITH LIMITED SYMBOLS

METATRADER TO TRADELOCKER TRADE COPIER - NON API APPROACH