Join our fan page
- Views:
- 951
- Rating:
- Published:
- 2025.05.28 11:50
-
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:
-
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.
-
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.
-
-
Position tracking: The EA tracks open positions using a specific Magic Number. This helps to distinguish trades executed by the EA from others.
-
Closing positions: When the cumulative profit of open positions exceeds the defined target, all positions associated with the EA are closed.
-
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 are collected here. The archive contains all necessary files to run the algorithms on test functions.

MQL5-Like Trade Classes in Python for MetaTrader 5 Python

This is a custom indicator for MetaTrader 5 whose sole purpose is to display a BMP image on the chart, centred on the screen. What is it for? It is used to display a static image (such as a logo, personal branding, chart message or reminder) directly on the trading chart, without affecting the analysis and market data. How does it work? It creates an OBJ_BITMAP_LABEL object to display an image (2.bmp) from the MQL5Images folder. It automatically calculates the centre of the chart and places the image there. It updates the position of the image on each new tick so that it is always centred, even if the window is resized.

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"). Draw the body of the candle: Draw a rectangle from the opening price to the closing price, using a different colour if the candle is bullish or bearish. Colour customisation: You can easily change the colours used for bullish and bearish candles and their wicks. In the code you use, for example: The bearish candles have a maroon body (clrMaroon). The wicks of the bearish candles are light violet (clrOrchid). What is it useful for? This indicator is useful if you want to: Have a unique and clear visual style on your charts. Differentiate bullish candles more easily from bearish ones. Analyse the price behaviour in a more visual way.