Skip to content
All library documents

Designing an MQL5 Symbol Object for Instrument Data and Classification

Article MQL5 articles

Summary

This installment describes the foundation of a reusable MQL5 symbol object for gathering and comparing instrument data. It proposes symbol categories such as major and exotic forex, metals, indices, cryptocurrencies, commodities, exchange-traded products, and custom symbols. Because category names and folder structures vary by broker, the planned classification first uses a user-defined category list, then the terminal’s symbol-tree path, and finally the contract price calculation method to distinguish exchange and forex instruments.

The implementation organizes symbol status and terminal properties into integer, real, and string enumerations, covering details such as prices, volume, trading permissions, contract settings, and currency information. A test program prints these properties and notes that some are unavailable in MQL4. This is primarily a software-library design article rather than a trading strategy: it explains data access and object structure, while the more advanced collection, search, and comparison features are deferred to a later installment.

Key ideas

  • A symbol object can provide a consistent interface for reading instrument properties.
  • Symbol categories are subjective, so classification can combine user-defined lists with terminal metadata.
  • The proposed object groups integer, real, and string properties into enumerations.
  • Property availability differs across platform versions, and unsupported fields need explicit handling.
  • Collection-level search, sorting, and symbol comparison are left for subsequent work.

Tags

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