In the process of using programmatic trading, have you encountered such a situation? The opening position of aEA is better, and the closing position of bEA is better. It would be perfect if these two EAs could be combined together!
Generally, we use 1 EA to open and close positions. If I want to handle opening and closing positions separately, that is to say, one EA program is used for opening positions, another EA program is used for closing positions, and both EAs manage orders.
We use DKX_EA_v2.1 and Hdging _EA_v3.8.8 as examples.
First, load DKX_EA_v2.1 and Hdging _EA_v3.8.8 on two EURUSD windows respectively.
Use DKX EA to open positions, most EA members like to use this EA to open positions, and it is usually quite accurate.
When the white line crosses the yellow line (gold cross), enter a long order, and when the white line crosses the yellow line (silicon cross), enter a short order. As shown in the figure:
As shown in the figure below, when the white line crosses the yellow line (gold cross), enter a long order.
Let’s open the HedgingEA loading window again, click “Profit and Loss Information” in “Information Display”, we can find that the orders placed by DKX EA are not managed by HedgingEA.
Find the DKX EA configuration file and open it with WordPad or Notepad. (For a detailed introduction to the configuration file, please visit:https://bangea.com/2022/02/21/regarding-the-parameter-configuration-file-of-programmatic-trading-it-is-enough-to-read-this-article/)
The number whose magic code is copied.
Find the configuration file of Hedging EA, open it with WordPad or Notepad, select and paste its magic code, that is, change Hedging’s magic code to be the same as DKX. During this process, make sure that HedgingEA stops running.
Go back to the window for loading HedgingEA again, open the information display and the profit and loss information in it, you can find that the orders placed by DKX EA are managed by HedgingEA.
Now we can make the corresponding closing settings in the Hedging EA.
Summary: By modifying the parameters of the configuration file, the parameters of the two EAs are the same, so that the two EAs can manage each other’s orders.