Skip to content
All library documents

Unity: Normalizing Currency and Metal Values into a Multi-Asset Indicator

Article MQL5 code base

Summary

Unity derives comparable values for currencies and metals from the quoted exchange rates between them. In a simple example with a currency pair and gold, it treats each asset as having an underlying value, then adds a constraint that the sum of squared values equals one. Solving the equations produces a normalized value for each asset. The method extends to a cluster of instruments that share a common base or quote currency, with contract sizes used to bring differently scaled quotes closer together.

By default, the indicator plots percentage changes in asset values between consecutive bars; an option displays the absolute values instead. It can also export buffer data to a CSV file, optionally adding a forward-shifted value of the last asset for use in forecasting. The document describes the calculation and available settings but gives no performance tests or evidence that its outputs predict prices. It recommends daily charts or higher, and the shared-currency requirement limits which instruments can be combined in a cluster.

Key ideas

  • The indicator infers underlying asset values from instrument quotes and a normalization constraint.
  • A cluster must consist of instruments that share a common base or quote currency.
  • Contract sizes are applied to make values derived from differently scaled quotes more comparable.
  • The default output is the bar-to-bar percentage change in each inferred value.
  • CSV export can include a forward-shifted value for forecasting experiments, but predictive performance is not established.

Tags

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