Previous Lecture Complete and continue  

  The 3 Types of Code

The 3 Main Types of Code in MQL5

  1. Expert Advisor (EA) is a mechanical trading system linked up to a certain chart. An Expert Advisor starts to run when an event happens that can be handled by it: events of initialization and deinitialization, event of a new tick receipt, a timer event, depth of market changing event, chart event and custom events. An Expert Advisor can both inform you of a possibility to trade and automatically trade on an account sending orders directly to a trade server. Expert Advisors are stored in terminal_directory\MQL5\Experts.

Translation: An EA is a trading strategy in a coded form. Its capabilities include, but are not limited to, opening and closing positions, sending notifications, creating graphics and storing information.

  1. Custom Indicator is a technical indicator written independently in addition to those already integrated into the client terminal. Like built-in indicators, they cannot trade automatically and are intended for implementing of analytical functions only. Custom indicators are stored in terminal_directory\MQL5\Indicators.

Translation: A custom indicator is an indicator developed by a MT5 user and not Metaquotes. An indicator processes information from the market using a formula and outputs this information as a value or action.

  1. Script is a program intended for a single execution of some actions. Unlike Expert Advisors, scripts do not process any actions, except for the OnStart event. Scripts are stored in terminal_directory\MQL5\Scripts.

Translation: A script does something once.