Forex MQL MetaTrader Code


MetaTrader Expert Advisors are automated, or mechanical, trading systems that execute on the FOREX market. 

FOREX trading systems vary greatly in their design and purpose.  One method that allows a FOREX trader to quickly develop new and profitable mechanical trading systems is to build a toolbox of well tested functions.  This method can greatly reduce the time and effort required to bring a new mechanical trading system on line.

These are some of the MetaTrader MQL files of the Expert Advisors and UserFunctions referenced throughout iExpertAdvisor


                             

 


Right click and choose save target as to save these files on your computer. An extension of txt has been appended to ensure your browser recognizes the file type.  Remove the txt extension before attempting to compile the MQL file.  (Note: Expert Advisors should be copied to your "experts" folder and Scripts should be copied to your "scripts" folder.)

  •  New! Sometimes you need to know the Magic Number of your open trades. Use this script to show the MagicNumbers of all open trades. Download GetMagicNumbers here.
  • When we develop and test our Expert Advisors, we often end up with many open trades.  It can be a real hassle to manually close all of these trades.  So, we developed this simple MT4 Expert Advisor to close all open and pending trades on an account. Download CloseTrades here.  

New!  We have converted this Expert Advisor to a script. It offers the same functionality, but as a script. Download CloseAll here.

 

 

Free MQL code will be added to this page periodically.

Questions about MQL 4? View the manual here.