Expert Advisor Programming
Expert Advisor Programming for MetaTrader 5 Book
Paperback Price: $39.95 USD
Buy the Book
eBook Price: $29.95 USD
Buy the Book

Expert Advisor Programming for MetaTrader 5

New! The first guide to programming in MQL5 is here! Expert Advisor Programming for MetaTrader 5 is a practical guide to creating automated trading strategies in the MQL5 language. Take advantage of MetaTrader 5's new features and take your trading to the next level!

You'll learn how to program expert advisors quickly and easily using a ready-made framework created by an experienced MQL programmer. This book will teach you the following concepts:

  • Learn the basics of MQL5, including variables and data types, operators, functions, event handlers, and object-oriented programming.
  • Place, modify and close market and pending orders.
  • Calculate, verify and add stop loss and take profit prices to an open position.
  • Add a flexible trailing stop and/or break even stop to your strategy.
  • Manage your trade risk with money management.
  • Use pending orders to scale in and out of positions.
  • Use price, time and indicator data in your expert advisors.
  • Control program execution by trading on new bar open, and add flexible trade timers to your strategies.
  • Walk through the creation of several basic trading strategies from start to finish.
  • Inform the user with dialog boxes, email alerts, mobile notifications and sounds.
  • Draw trend lines, arrows and text labels on the chart.
  • Read and write data to CSV files.
  • Learn the basics of creating indicators, scripts and libraries in MetaEditor.
  • Debug, test and optimize your trading strategy.
  • And much more!

Whether you're an experienced programmer moving from MQL4, or a novice just starting with MQL5, this book will give you the foundation to quickly program fully-featured and robust trading systems.

You can purchase the paperback directly through this website, from Amazon (US/UK/EU) or through your local bookseller. The eBook is in PDF format and is only available through this website!

Download MQL5 Source Code

All include files and sample programs featured in the book, along with additional documentation, are available for download:

Download MQL5 Source Code


Expert Advisor Programming MQL MetaTrader 4 Book
Paperback Price: $29.95 USD
Buy the Book
eBook Price: $19.95 USD
Buy the Book

Expert Advisor Programming for MetaTrader 4

The original guide to programming in MQL4! Expert Advisor Programming guides you through the process of developing robust automated forex trading systems for the popular MetaTrader 4 platform.

In this book, the author draws on several years of experience coding hundreds of expert advisors for retail traders worldwide. You'll learn how to program these common trading tasks, and much more:

  • Place market, stop and limit orders.
  • Accurately calculate stop loss and take profit prices.
  • Calculate lot size based on risk.
  • Add flexible trailing stops to your orders.
  • Count, modify and close multiple orders at once.
  • Verify trading conditions using indicators and price data.
  • Create flexible and reusable source code functions.
  • Add advanced features such as timers, email alerts and Martingale lot sizing.
  • Avoid common trading errors and easily troubleshoot your programs.
  • Adjustments for fractional pip brokers and FIFO.
  • Plus, learn how to create your own custom indicators and scripts!

Whether you're a beginner or an experienced programmer, Expert Advisor Programming can help you realize your automated trading ideas in the shortest amount of time. This book features dozens of code examples with detailed explanations, fully-functioning example programs, and reusable functions that you can use in your own expert advisors!

Download MQL4 Source Code

This ZIP file features all of the source code from the book appendixes, as well as code examples from throughout the book. All corrections from the first printing of the book are included as well:

Download MQL4 Source Code


MQL4 Questions and Answers

  • Will the source code in the book still work for MetaTrader 4 buils 555 and higher?

    Yes, all of the source code has been tested with the new MetaTrader 4 versions. In additional, all of the MQL4 skills you'll learn in the book will still be relevant to programming in MetaTrader 4, even with the merging of MQL4 and MQL5 features.

  • Will you be updating the MQL4 book to reflect the recent language changes?
  • I plan to write a second edition of the book that will address the new language elements that have added from MQL5. As of right now, I don't have a release date for the book, as it takes several months to rewrite, edit and design a new book.

  • Should I bother learning MQL4?
  • While it looks like MQL4 will be around for a while longer, if this is your first time learning the MQL language, I suggest you start with MQL5. It is a modern language with more powerful features, and the new MQL4 features (object-oriented programming, etc.) are taken directly from MQL5. If you wish to stick with MetaTrader 4, then you can learn MQL4 now, and move up to learning the MQL5 features as your abilities progress.


Contact Us

If you have any issues with your eBook purchase or download, or if you simply have questions or comments about the book, please feel free to email us.

Contact Form