Arbitrage EA Using a Simple Formula

MQL4 Experts

Job finished

Execution time 7 minutes
Feedback from customer
Excellent work! I am very impressed with the quality of the EA.
Feedback from employee
Amazing cant wait for next work

Specification

I need an EA that trades when the price difference between 2 brokers is large.

Summary:

On the same computer, I will use 2 MT4 terminals - Primary MT4 and Secondary MT4. There will also be 2 EAs - Primary EA and Secondary EA. The Primary EA will be installed in Primary MT4. Secondary EA will be installed in Secondary MT4. The Secondary EA is like a monitor to send ask and bid prices to the Primary EA. The Primary EA will analyze the data every second, and trade if conditions are met.

I will trade multiple symbols on the primary MT4, with different magic numbers. For each symbol, there will be a Primary EA and a Secondary EA. They will work independent from one another. 


Details:

There are 7 parameters that are used for calculation.

AskPrimary: Current Ask price in primary MT4

BidPrimary: Current Bid price in primary MT4

AskSecondary: Current Ask price in secondary MT4

BidSecondary: Current Bid price in secondary MT4

D: This is a manual parameter that I will input in the settings. This is a multiplier to convert the price to points. In general, JPY pairs have D=1000. Non-JPY pairs have D=100000.

S: This is a manual parameter that I will input in the settings. This is a number such as -1, 1, 2.5 or 0.

P: This is a manual parameter that I will imput in the settings. This is a positive number such as 2, 2.5 or 3.


Just follow the formula below to code the EA. You do not need to understand what the formula means.

Condition to Sell:

D*(-0.5*AskPrimary + 1.5*BidPrimary- 0.5*AskSecondary - 0.5*BidSecondary) ≥ S + P


Condition to close Sell:

D*(0.5*AskPrimary + 0.5*BidPrimary - 0.5*AskSecondary - 0.5*BidSecondary) ≤ S + 1


Condition to Buy:

D*(1.5*AskPrimary - 0.5*BidPrimary - 0.5*AskSecondary - 0.5*BidSecondary) ≤ S - P


Condition to close Buy:

D*(0.5*AskPrimary + 0.5*BidPrimary - 0.5*AskSecondary - 0.5*BidSecondary) ≥ S - 1


(Please show the calculation in the Experts log when Primary EA opens or closes a trade. This is so that I can check if calculation is correct)


-Primary EA Settings-

D: Parameter used for calculation.

S: Parameter used for calculation.

P: Parameter used for calculation.

SuffixPrimary: Suffix of the symbol in Primary MT4

TimeRange: This is the time range for the Primary EA to trade in broker time. For example, 9:00-20:00 means Primary EA will trade from 9am to 8pm broker time. (You can use a different format for this setting if you want)

EquityPerLot: Equity required for each lot to trade. For example, if EquityPerLot=1000, and equity is 5000, EA opens 5 lot for each trade.

TakeProfit: Profit target in points. You can use the parameter D to calculate the take profit price.

StopLoss: Stop loss in points. You can use the parameter D to calculate the stop loss price.

MinutesToClose: Primary EA will close trades that are open for too long. For example, if MinutesToClose=20, EA will close trades that are open for 20 minutes.

MagicNumber: Magic number. I will trade multiple symbols, so there will be multiple Primary EAs in the primary MT4 for multiple symbols.


-Secondary EA Settings-

SuffixSecondary: Suffix of the symbol in Secondary MT4


Note 1: Primary MT4 and Secondary MT4 are in same time zone.

Note 2: Each Primary EA with same magic number can open max 1 trade at a time.



====== Method to send AskSecondary and BidSecondary data to Primary EA =======

This is an important part of the EA. The secondary data has to be sent quickly to the primary EA every second, without error or lag. The Primary EA will then compare the secondary data every second and use the formula (see above) to calculate whether to open or close trades. If there is lag, AskPrimary and BidPrimary will have increased/decreased by the time it reads AskSecondary and BidSecondary. This will create a calculation slippage, and some correct trades could be missed, or some wrong trades could open.


One method to send the secondary data to Primary EA is via an exchange file. The secondary EA can send AskSecondary and BidSecondary to an exchange file in C:\Users\Username\AppData\Roaming\MetaQuotes\Terminal\Common\Files every second. Then, the primary EA can read this file every second, and then do the calculation. (With multiple symbols, there will be multiple exchange files.)


LET ME KNOW IF YOU HAVE A BETTER METHOD. THE SYNCHRONIZATION SHOULD BE AS FAST AS POSSIBLE, LESS THAN 1 SECOND IF POSSIBLE.

Responded

1
Developer 1
Rating
(171)
Projects
230
46%
Arbitration
17
82% / 12%
Overdue
35
15%
Loaded
2
Developer 2
Rating
(42)
Projects
47
30%
Arbitration
12
17% / 75%
Overdue
6
13%
Free
3
Developer 3
Rating
(5)
Projects
6
50%
Arbitration
2
0% / 50%
Overdue
0
Free
4
Developer 4
Rating
(101)
Projects
136
36%
Arbitration
14
29% / 50%
Overdue
15
11%
Free
5
Developer 5
Rating
(74)
Projects
121
43%
Arbitration
12
33% / 50%
Overdue
17
14%
Free
6
Developer 6
Rating
(465)
Projects
493
52%
Arbitration
10
60% / 20%
Overdue
3
1%
Free
7
Developer 7
Rating
(40)
Projects
86
13%
Arbitration
29
31% / 48%
Overdue
35
41%
Loaded
8
Developer 8
Rating
(118)
Projects
169
38%
Arbitration
9
78% / 11%
Overdue
15
9%
Working
9
Developer 9
Rating
(43)
Projects
72
49%
Arbitration
4
0% / 50%
Overdue
19
26%
Free
10
Developer 10
Rating
(66)
Projects
143
34%
Arbitration
10
10% / 60%
Overdue
26
18%
Working
Similar orders
I have an EA that has a nasty drawdown but otherwise is quite profitable. I am looking for a developer who can improve the drawdown by closing or hedging the older open orders. You'll need to supply a demo showing that you've solved this problem rather than just claiming that you can fix it
dear developers.i want to modify my custom indicator by adding new rules for alerts and arrows,the indicator is based upon some trend following rules and the indicator should be able to send out all types of alerts.i will need demonstration...thank you
Looking for a developer of profitable EA tested for over 2 or more years time history of profits with investors read me only access as proof of usage. MT4 or MT5
Adjust MY Hedging EA 30 - 40 USD
1. Need averaging TP for my hedging EA. (Close both Buy and Sell position with TP) 2. Add function auto/manual entry. (EA will entry based on manual position(placed by trader) or auto trade based on existing setting)
I have a robot set up that sends trading signals to my telegram group and the group sends trading signals for (28 forex pairs, 3 crypto pairs, 6 commodities, 6 indexes, & 55 stocks) basically almot 100 CFDs and sends out trend price action breakout, impulse, reversal, and exit indications to each one of those CFDs on different timeframes. I want to make it so that a person can sign up and choose which alerts they
I am in search of a skilled robot developer to craft a Martingale with Hedge strategy algorithm. The ideal candidate will possess deep expertise in algorithmic trading, proficiency in programming languages, and a keen understanding of financial markets. The role entails designing and implementing an automated system capable of effectively executing the Martingale strategy while integrating a hedge mechanism to manage
Create an EA zigzag 40 - 80 USD
Zigzag EA sends notify on MT4 mobile app indicator have 2 Conditions all are explained in the pictures accurately and clearly https://drive.google.com/file/d/10Y6SrvC2A7RTT_baAJ7vOKytTDaUvRRQ/view?usp=sharing Warning: Do not send me a notification if your offer is higher than $ 100 because I did the project twice for less than $60 And I want to do the project now because there are mistakes on my part that I want to
Hello developers, Thanks in advance for checking my order. I have been creating and trying to mastering this strategies for a long time and finally it's time to automate it. I’m not sure if everything I imagined can be done. I tried my best to explain whats needed for the ea and how it should performance but due my lack of knowledge in programming probably you will have some questions soo feel free to ask.. Only
MA Crossover EA 30+ USD
I need someone to create an MA crossover EA. This program should be able to trade the crosses. We would be using the MA indicators to make decisions about buying and selling stocks or other assets. The MA crossover would help me invest my money more effectively by automatically executing trades based on these indicators. If you can create this program, please let me know as I am interested in working with you
MT4 EA 30+ USD
I have project for expert developer here.. The task is to make the EA take trades using the indicator upper line and the lower line to take trades. When the upper line appears on the chart I need the EA to take a sell at that point. Then when the lower line shows up I need the seel trade to close. The same concept applies for the lower line. I need the EA to take a buy trade when the lower line appears and close when

Project information

Budget
100+ USD
For the developer
90 USD