Skip to content
All library documents

Cross Orders for Trading Futures from Historical Charts in MetaTrader

Article MQL5 articles

Summary

This article describes a MetaTrader 5 cross-order system for analyzing continuous historical futures data while placing orders in the currently valid contract. It focuses on Brazilian mini-dollar and mini-index futures, explaining their symbol prefixes, month codes, year suffixes, and expiration conventions. The Expert Advisor derives a current contract symbol from those rules and checks its expiration date, so the trader can use older contract history for chart analysis while directing orders to the tradable contract.

Because MetaTrader’s native order display does not adequately represent orders on the historical chart, the article introduces a class that hides native trade levels and draws horizontal lines for entry, stop, and take-profit prices. The implementation also handles selection and cleanup of those chart objects. This approach recreates some order-management behavior outside the platform’s built-in system. The author emphasizes that error handling is limited and orders are processed on each tick, which can strain the system when many are open; thorough demo testing across market conditions is advised. The article gives no performance or profitability results.

Key ideas

  • Cross orders let a historical futures chart support analysis while orders target the current contract.
  • Contract names are generated from instrument prefixes, expiration month codes, year digits, and exchange-specific expiry rules.
  • A custom chart class represents order prices and protective levels with horizontal lines.
  • The custom system replaces some native platform behavior and requires careful testing because error handling is limited.

Tags

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