Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

MetaTrader 5 Script | Programming Patterns - Observer

MetaTrader Experts, Indicators, Scripts and Libraries


  • Subjects update observers through interface.
  • Subjects knows nothing about the observers (one-to-many weak relation).
  • New data can be broadcast by the subject, or requested by the observers (better).
  • Order of notification is not guaranteed.

RULE: Use weak connection between communicating objects.

26732