TAG

script

  • November 5, 2025

Your First Script

Overview In MQL5, a script is a simple program designed to perform a single action and then terminate. Unlike Expert Advisors (EAs), which run continuously with every new market tick, a script executes its code only once when launched. Scripts are ideal for quick operations such as sending a message to the log, closing all trades, or performing calculations that do not require constant updates. This section will guide you through creating and running your first MQL5 script. What You Will Be Able to Do Code Example Execution Steps Key Point Scripts always begin execution with the OnStart() function and stop automatically once the code inside it finishes. They are best suited for one-time tasks, such as modifying trade positions, exporting data, or testing short pieces of code. As you progress, you’ll find scripts useful for both learning MQL5 and performing small maintenance operations in your trading workflow. Next Section→ Next: Understanding Print

  • November 4, 2025

Getting Started with MQL5

Overview MetaTrader 5 is a comprehensive trading platform that allows traders to analyze markets, run indicators, and automate strategies. To make automation possible, MetaTrader includes its own programming language — MQL5 (MetaQuotes Language 5). It is a C-like language designed specifically for trading automation, allowing you to build scripts, indicators, and expert advisors (EAs) that execute trades automatically. MQL5 improves upon its predecessor, MQL4, by introducing object-oriented programming and faster execution, making it a robust choice for modern algorithmic trading. What You Will Be Able to Do Code Example Execution Steps Key Point MQL5 programs are executed within the MetaTrader 5 terminal environment. Each program type serves a distinct purpose — Scripts for one-time actions, Indicators for data visualization, Expert Advisors for automated trading, and Services for background tasks. Together, they form a flexible ecosystem that allows traders to automate nearly every aspect of their strategy. Next Section → Next: What Is MetaEditor