Brand new and fully updated for the latest versions of MetaTrader 4, Expert Advisor Programming for MetaTrader 4 is a practical guide to programming expert advisors in the MQL4 language. Leverage the latest features imported from the MQL5 language, including object-oriented programming, enumerations, structures and more. This book will teach you the following concepts:
- The basics of the MQL4 language, including variables and data types, operations, conditional and loop operators, functions, classes and objects, event handlers and more.
- Place, modify and close market and pending orders.
- Add a stop loss and/or take profit price to an individual order, or to multiple orders.
- Close orders individually or by order type.
- Get a total of all currently opened orders.
- Work with OHLC bar data, and locate basic candlestick patterns.
- Find the highest high and lowest low of recent bars.
- Work with MetaTrader’s built-in indicators, as well as custom indicators.
- Add a trailing stop or break even stop feature to an expert advisor.
- Use money management and lot size verification techniques.
- Add a flexible trading timer to an expert advisor.
- Construct several types of trading systems, including trend, counter-trend and breakout systems.
- Add alerts, emails, sounds and other notifications.
- Add and manipulate chart objects.
- Read and write to CSV files.
- Construct basic indicators, scripts and libraries.
- Learn how to effectively debug your programs, and use the Strategy Tester to test your strategies.
All of the source code in this book is available for download, including an expert advisor framework that allows you to build robust and fully-featured expert advisors with minimal effort.
Whether you’re a new trader with limited programming experience, or an experienced programmer who has worked in other languages, Expert Advisor Programming for MetaTrader 4 is the easiest way to get up and running in MQL4.