Watch how to download trading robots for free
Find us on Twitter!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Views:
2445
Rating:
(7)
Published:
2025.05.28 11:50
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

This Expert Advisor (EA) is designed to perform triangular arbitrage between three currency pairs: EURUSD, USDJPY and EURJPY. The main objective is to exploit price discrepancies between these pairs, identifying arbitrage opportunities and opening positions to capitalise on them.

Description of functionalities:

  1. Identifying opportunities: The EA calculates the implied price of EURJPY by multiplying the Ask prices of EURUSD and USDJPY. This value is then compared to the EURJPY direct price. If the relative difference exceeds a defined threshold, an arbitrage opportunity is recognised.

  2. Opening of positions: When an opportunity is identified:

    • If the implied price is higher than the direct price, the EA executes a set of trades including buying EURJPY and selling EURUSD and USDJPY.

    • If the implied price is lower, the EA executes the reverse trade.

  3. Position tracking: The EA tracks open positions using a specific Magic Number. This helps to distinguish trades executed by the EA from others.

  4. Closing positions: When the cumulative profit of open positions exceeds the defined target, all positions associated with the EA are closed.

  5. Error handling: The EA includes error checks to ensure that any problems when opening or closing positions are reported.

In summary, this EA automates the triangular arbitrage process with a systematic approach, optimising returns based on price discrepancies.


Translated from Italian by MetaQuotes Ltd.
Original code: https://www.mql5.com/it/code/57272

Population-based optimisation algorithms Population-based optimisation algorithms

Population-based optimisation algorithms are collected here. The archive contains all necessary files to run the algorithms on test functions.

Trade Classes in Python - CTade, CSymbol, CPositionInfo, etc. Trade Classes in Python - CTade, CSymbol, CPositionInfo, etc.

MQL5-Like Trade Classes in Python for MetaTrader 5 Python

Customised bmap chart Customised bmap chart

This is a custom indicator for MetaTrader 5 whose sole purpose is to display a BMP image on the chart, centred on the screen

Change the colour of candles and wick Change the colour of candles and wick

Draw the wicks (thin lines): Draw a vertical line from the lowest price to the highest price of each candle (this is called a "wick")

This website uses cookies. Learn more about our Cookies Policy.