Skip to content
All library documents

Correlation-Based Pair Trading with Profit-Offsetting Positions

Article MQL5 code base

Summary

This document describes an automated or manual pair-trading robot that opens positions in two symbols when their correlation meets a configured threshold. It distinguishes pairs, whose charts move similarly, from mirror symbols, whose charts move in opposite directions. The lot sizes are intended to make gains on one leg offset losses on the other under what the document calls tranquil correlation conditions. The robot then waits for positive combined profit before closing both positions.

Parameters include the correlation threshold for opening trades, the number of retries if an order fails, and the lot size for each symbol. EURUSD and USDCHF are named as an example, but the document supplies no numerical performance results or detailed testing evidence. Correlation can change, and the described profit-offset assumption is explicitly tied to stable correlation conditions; the text does not explain risk controls for correlation breakdowns, transaction costs, or adverse execution. It presents a basic mechanism rather than a fully specified or validated strategy.

Key ideas

  • The robot opens two symbol positions based on a configured correlation threshold.
  • Similar chart patterns define pairs, while reflected patterns define mirror symbols.
  • Lot sizes aim to offset one leg's profit against the other leg's loss during stable correlation.
  • The system waits for positive combined profit before closing positions.
  • The document does not provide backtest results or detail safeguards for correlation changes.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.