Arbitrage EA Using a Simple Formula

MQL4 Uzman Danışmanlar

İş tamamlandı

Tamamlanma süresi: 7 dakika
Müşteri tarafından geri bildirim
Excellent work! I am very impressed with the quality of the EA.
Geliştirici tarafından geri bildirim
Amazing cant wait for next work

İş Gereklilikleri

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.

Yanıtlandı

1
Geliştirici 1
Derecelendirme
(173)
Projeler
232
45%
Arabuluculuk
17
82% / 12%
Süresi dolmuş
35
15%
Çalışıyor
2
Geliştirici 2
Derecelendirme
(42)
Projeler
47
30%
Arabuluculuk
12
17% / 75%
Süresi dolmuş
6
13%
Ücretsiz
3
Geliştirici 3
Derecelendirme
(5)
Projeler
6
50%
Arabuluculuk
2
0% / 50%
Süresi dolmuş
0
Ücretsiz
4
Geliştirici 4
Derecelendirme
(101)
Projeler
136
36%
Arabuluculuk
14
29% / 50%
Süresi dolmuş
15
11%
Ücretsiz
5
Geliştirici 5
Derecelendirme
(74)
Projeler
121
43%
Arabuluculuk
12
33% / 50%
Süresi dolmuş
17
14%
Ücretsiz
6
Geliştirici 6
Derecelendirme
(466)
Projeler
494
52%
Arabuluculuk
10
60% / 20%
Süresi dolmuş
3
1%
Ücretsiz
7
Geliştirici 7
Derecelendirme
(40)
Projeler
86
13%
Arabuluculuk
29
31% / 48%
Süresi dolmuş
35
41%
Yüklendi
8
Geliştirici 8
Derecelendirme
(119)
Projeler
169
38%
Arabuluculuk
9
78% / 22%
Süresi dolmuş
15
9%
Ücretsiz
9
Geliştirici 9
Derecelendirme
(43)
Projeler
72
49%
Arabuluculuk
4
0% / 50%
Süresi dolmuş
19
26%
Ücretsiz
10
Geliştirici 10
Derecelendirme
(66)
Projeler
143
34%
Arabuluculuk
11
9% / 55%
Süresi dolmuş
26
18%
Çalışıyor
Benzer siparişler
Hey, having privilege to discuss my trading ideas with a skilled programmer will be the best, I wanted to build a well automated expert advisor that run perfectly on both MT4 and MT5, I would be glad to work with an expert who is able to turn ideas into a well automated mt4 mt5 trading robot, expert advisor EA in Metatrader 4 and 5, reach out if you can help me in achieving my trading target thanks
I need a software developer to make a robot using Zig and Zag on high - low trend.V2 and fibo-pivots-alerts-levels indicators. Management must be based on the account size. The developer must be able to complete the job in 3 days. I will send files to the developer who'll do the job for me
i want an EA that enters based on the form of a candle if the lower wick is bigger then the rest of the candle i want buy and if the upperwick is bigger then the rest of the candle i want a sell single, i want it to enter with the sl 1 tick lower or higher then the lower or upperwick depening on buy or sell trade. then the stoploos needs to move when the trade goes to 0,5% sl too break even, when trad eis on 1% sl to
óla amigos precisos de uma específica de programas gratuitos em um único indicador ja tenho a combinação pornto presciso apenas de um amigo desenvolvedor que conseguir unir todos em uma única aplicação
Hello guys, two EAs, one on MT4 the other is on MT5 First EA I need to convert a trading view indicator "Pine script" into mql4 indicator and I want to use it in an EA. You can find the indicator at this link and this is the indicator name “demand and supply zones”. the indicator shows rectangles on the chart those are the support and resistance area, we will take a trade from those rectangles. Drawing are
I need trading view developer to help me with building a strategy from scratch. Trying to create a indicator that will allow me to backtest grid bot performance on trading view
Hello to all developers, I need someone that can help me with my ea project. I want to do ea Only reverse engineering (writing from scratch by analyzing the algorithm), without decompilation Here are the files https://drive.google.com/folderview?id=1A9uJNbvFM1pvYHRLTIDf5ThgeJu88eJp
Fix my ea and add reverse trade feature plus has Make ea with trailing stop, once trade is closed in loss open in opposite, close in win open in same position. The ea must trail from 0 ( from the start)
Seeking a skilled developer to craft an Expert Advisor leveraging the Smart Money concept, boasting a formidable 70% win rate. This EA will adeptly identify order blocks, demand and supply zones, while prudently managing trades based on account size to limit risk to 1-2%. Elevate your trading strategy and maximize returns with this innovative solution
Hello, I am a trader and I have a certain strategy I want to code to an automated EA , so I am seeking for an experienced developer to code a custom trading strategy into an Expert Advisor (EA) for MetaTrader 4 (MT4). The strategy is based on a meticulously backtested algorithm and requires precise execution in live market conditions. If you have the skills and experience to undertake this project, please reach out

Proje bilgisi

Bütçe
100+ USD
Geliştirici için
90 USD