Articles by: David Williams

Automatic Alpha Trading System: Reinforced with an MT4 Expert Advisor

Automatic Alpha: Trading System/MT4 Expert Advisor Ebook

Automatic Alpha Ebook: How to Build a Winning FOREX Trading System

Automatic Alpha Ebook: How to Build a Winning FOREX Trading System

This is a risk free opportunity for you to learn the art of building an automated trading system.  Keep reading to learn how we can offer this product to you without you risking a dime!

    What is Automatic Alpha?

Automatic Alpha is an 80+ page ebook that fully describes the process of developing a winning trading system. Building a winning trading system can be an illusive task.  Fact: Most traders will never develop a winning trading system without using the techniques described in Automatic Alpha.

Automatic Alpha introduces a framework, The Trading System Development Lifecycle, that completely describes trading system development.  Once a trader learns this framework they can immediately begin to develop their own winning trading systems.

The concepts described in Automatic Alpha are reinforced with the implementation of a fully automated trend following trading system, named AutoAlpha.

AutoAlpha is implemented using both MetaTrader versions 3.x and 4.x MQL languages.  The full MQL source code for both versions is provided with the ebook.

The AutoAlpha entry is viable on all pairs.  The AutoAlpha exit, as described in the ebook, was developed specifically for the highly-liquid, low-spread EUR/USD currency pair.

AutoAlpha is a medium-term trend-following system.  It opens, on average, about 2 trades per week.  The initial stoploss and takeprofit values are multiples of the 24-period ATR: the stoploss and takeprofit are usually within the range of 75 to 135 points.  Most trades last about 2-3 days.

View the equity curve of AutoAlpha below.  This graph depicts back-tested results from 5/2003-7/2005.  Only one lot is used per trade and all trading commissions are included.  AutoAlpha is a robust trend following system and has provided an average of 50 points per month over the last several years.  A trend-following system was chosen as the subject of Automatic Alpha because trend-following is one of the few strategies that has proven reliable over the long term.  The AutoAlpha trading system is similar to black box systems that are currently sold for thousands of dollars.


Automatic Alpha is both a comprehensive book – teaching you how to develop your own winning systems, and an actual trading system.  You can start running a winning trading system today.Here is the table of contents of Automatic Alpha.


Who should read Automatic Alpha?

  • Traders interested in building their own winning trading systems.
  • Traders that want to start running a winning trading system today.
  • Anybody interested in learning how most winning trading systems are outlined, developed, tested and finally qualified.

        Are you a chart-watching discretionary trader? 

  • Read Automatic Alpha to learn how to automate your manual trading system.

        Are you new to FOREX trading?

  • Learn the inherent advantages of mechanical system trading.  Get started off on the right foot and start running a winning trading system immediately

Read the Preface of Automatic Alpha below.


How will Automatic Alpha help you?

Learn to turn your own creative ideas into winning trading systems.

Learn to quickly determine if a trading strategy is worthy of further development effort.

Learn to build a robust trading system – one that has a very good chance of working in the future.

The base system, AutoAlpha, which is used to exemplify The Trading System Development Lifecycle, is a solid and robust system.  However, there is a very important chapter in Automatic Alpha which lists suggested improvements to AutoAlpha.  These improvements can be used to significantly improve the performance of the base system – and the exact implementation of these improvements will be yours and yours alone!

To learn what mechanical trading is really like, you need to actually run a system.  Since the MetaTrader platform is free and widely available, you can start running a system within hours of purchasing Automatic Alpha.

Don’t waste your valuable time learning the lessons that successful mechanical traders already know.  Read Automatic Alpha and learn in a few days what takes most traders years (and thousands of dollars) to learn.

Automatic Alpha is only $99 USD. The AutoAlpha trading system is implemented as an MT4 Expert Advisor. This includes the complete MQL source code (for both MetaTrader 3 and 4) of the AutoAlpha trading system.  

 Click below to order your copy of Automatic Alpha Today!


MetaTrader Build 600 Released. Big MQL Changes that Make MT4 More Like MT5

MetaTrader Build 600 has been Released

Please see the bottom of this post for the latest updates.

On February 4th, MetaQuotes released build 600. This is a major update of MetaTrader 4.

Some brokers will push the update to you when you connect. You should contact your broker to find out when you will get the update.

Build 600 is a major change to the MQL4 language. Basically, MetaQuotes has taking all of the features of MT5 and forced them into MT4.

The MT5 features are nice. But the problem is that build 600 is not 100% backward compatible. This means after the update to build 600, some of your Expert Advisors will not build.

Visual Traders Studio (VTS) has been updated to work with build 600.

The VTS version that supports build 600 is

(Here are VTS update instructions:

VTS converts your drawings into MQL code, and then uses the MetaTrader compiler to build the MQL code into an Expert Advisor.

The MetaTrader compiler prior to build 600 was “metalang.exe“. The new compiler introduced with build 600 is “mql.exe“.

The latest release of VTS ( allows you to select the new compiler as “mql.exe”.  There were also a few other changes made to the generated MQL code in this release.

When you build your system from within VTS, if VTS can not find “metalang.exe” it will automatically look for “mql.exe” and will continue building.

If “mql.exe” can not be found, you’ll need to manually set the compiler. This is done from the VTS Main menu:


This is the MultiPlatform window:


Clicking the “Add” button will open a file selection dialog. Navigate to the location of your MetaTrader platform and select the file “mql.exe”.

There is still support for the “metalang.exe” compiler for VTS users that do not upgrade to MetaTrader build 600.

Also, on the file selection dialog , the bottom right pull-down menu offers a file filter. This makes it easier to locate the correct file for selection. The filter supports “metalang.exe”, “mql.exe”, and “mql64.exe”.  In addition, the filter can be set to “*.exe”, which allows selecting any executable file – in case MetaQuotes changes the name of the compiler again!

Select MetaTrader Compiler as mql5.exe or metalang.exe

Select MetaTrader Compiler as mql5.exe or metalang.exe


NOTE: With the new “mql.exe” compiler you will see many more warnings. Remember, warnings do not prevent an EA from building.  (Errors will prevent an EA from building.)

VTS Will Continue to be Updated to Support MetaTrader Updates

We fully expect additional issues to arise. We are currently running 100% regression tests on all code paths (including all plug-ins). We anticipate a few more VTS updates over the next few weeks. We’ll post update information here.

Thanks for using VTS. This situation is one of the best reasons to use VTS.  As a trader, you want to focus on trading and system building – not on syntax errors and compilers! You focus on your drawings, and we’ll focus on converting those drawings to whatever programming language is needed to automate your system.

Here is a link to the MetaQuotes release notes for technical information on the update:

Here are some other links that may have helpful info:

Latest Updates

Monday, February 10, 2014

We  released VTS version to address a few more Build 600 issues.

This new release addresses the issues below:

  • fix fibo default parameters
  • copy EA to MQL4 folder
  • changes to grid code to support mql5
  • save candlestick parms with different container names
  • catch exception when dropping into treeview in toolbox

Tuesday, February 11, 2014

MetaQuotes continues to release new builds (up to build 604). We continue to monitor the changes  and will make updates to VTS as we become aware of any issues.

These are the outstanding issues we have that will be included in the next VTS release (

  • The ex4 file for EAs is not being copied to the new Build 600 folder “MQL4\Experts” (only the mq4 file is being copied)
  • Scripts are not being copied to the new Build 600 folder “MQL4\Scripts”
  • All strings are now UNICODE, so some “message box” information is garbled.
  • There problems finding the standard include files.

Feel free to post any issues you are seen here, or send us an email at

Remember, the bottom line is that we’ll continue to update VTS so that your systems build correct Expert Advisors for both pre-Build 600 and post-Build 600 MT platforms.


Expert Advisor Files Not in Correct Location

 This issue will be addressed in the next build.  In the mean time here is a work around. 

The mql file is being copied to the new build 604 directory. Which is “MQL4\Experts”
This was added to VTS version
VTS should also copy the EX4 file.  It currently does not, we’ll add this to the next build.
In the mean time:
After building your system in VTS,  open the MetaEditor and press F7 to compile the system. It will then appear in the MetaTrader platform.  As a last resort you can close the MetaTrader platform and re-open it.  This will cause the EA to appear as well.

Include Files Missing (stdlib.mqh, etc)

The include folder for pre-Build 600 was “experts\include”.  For post build-600, the folder is “MQL4\Include”.

These are MQL source code files that are “included” into the main MQL file. (Include, header files,  usually contain function prototypes and definitions).

VTS-generated MQL files reference some include files and expect them to be either in the “include” folder, or the current folder.

These files are most likely on your PC in the pre-Build 600 include folder. Something like:

C:\Program Files (x86)\MetaTrader 4\experts\include

They should be copied to the new folder, which is something like:

C:\Program Files (x86)\MetaTrader 4\MQL4\Experts

If you get an error about a missing include file, copy the file to the new “includes” folder (“MQL4\Include”).

I’ve attached the files here in a ZIP file.


VTS Release

We just released a new version of VTS to address the remaining build-600 issues.

Note: All of these changes are backward compatible, so you should be able to switch back and forth between pre-Build 600 and post-Build 600 MT builds without any worries.

VTS copies EAs, scripts, and in the case of the ea-indicator plug-in, indicators to the normal MetaTrader “experts” folder, and checks if the “MQL4\Experts” folder exists, and if so, copies the files to that folder as well.

The Custom indicators that you see in the Functions ToolBox are always sourced from the new folder “MQL\Indicators”, if the folder exists.  If you change the MetaTrader platform used by VTS by going to Tools->Options->MultiPlatform, you can right click on the  Custom indicators menu in the Functions ToolBox to refresh the list.

NOTE: If you have updated to MT Build 600, it’s important to source your custom indicators from the  “MQL\Indicators” folder because this is where MT looks for the indicator when the EA is running. If the custom indicator only exists in the pre-build 600 folder, it will not be loaded and found when the EA is running.  The build-600 update copies all of your  EAs, scripts, and custom indicators to the new folders.  VTS insures that you are getting the custom indicators from the correct location.

Although VTS copies all of the EA files to all of the correct locations, the EA may still not appear in the MetaTrader experts menu (or the Strategy tester) until you close the MT platform and restart it.  This is annoying and I am working on it.  The only decent work-around I’ve found to date is to leave the MetaEditor open, and after building the system in VTS, recompile the MQL in the MetaEditor by pressing F7 or clicking the compile button.  (The MQL file is automatically refreshed in the MetaEditor in most cases. There clearly a few bugs left to be fixed in build 610).


There were a few other fixes related to “wide-strings” and the arrays used in the grid plug-in. There were also some fixes related to the save-as function that were not related to the build 600 update (regular old bugs!)

Thanks for the feedback from everyone – it really helps.  As of today, we did full testing against MT build 610.  I’m sure MT will keep releasing upgrades for the issues traders are seeing on the platform, but I don’t expect them to be as disruptive as the first build 600 update.  In any event, I do expect we’ll find a few more issues, and there will be VTS updates to address them.

(Here are VTS update instructions:



We just released a new version of VTS to address the remaining build-600 issues.

Note: All of these changes are backward compatible, so you should be able to switch back and forth between pre-Build 600 and post-Build 600 MT builds without any worries.

We added a few more changes to make sure EA’s are created properly and placed in the correct folders:

  • VTS will search for the needed include files (stderr.h, etc.) and pass the location to the MetaTrader compiler
  • After a successful build, VTS will copy EAs to any MetaTrader ‘AppData” folder
  • VTS writes the location of all Expert Advisor files to the Output window (at the bottom of VTS).  If you are not sure where your EAs were built, check this window for the exact path.
  • VTS allows you to define 2 folders where your EAs will be copied to after a successful build. In VTS, got to Tools->Options->Preferences to see these choices:
    • Mq4CopyFolder1   (folder 1 where the EA’s mql code is copied)
    • Mq4CopyFolder2  (folder 2 where the EA’s mql code is copied)
    • Ex4CopyFolder1    (folder 1 where the EA’s ex4 code is copied)
    • Ex4CopyFolder1    (folder 2 where the EA’s ex4 code is copied)
VTS Preferences

VTS Preferences





















There was a build error with the “Platform Test EA” that has been resolved.

The function “fnIsTrendLineBroken” was updated to support the MQL5  stricter “switch” statement syntax.

There were a number of other updates and fixes in version not related to build 600. They can be viewed in the VTS README file.


Update March 24, 2014:  MetaTrader Build 616

In build 616, MetaQuotes has removed the compiler (mql.exe or mql64.exe) from the standard MetaTrader installation. This was not a mistake – they intentionally removed the compiler (I have no idea why!)

This means when you upgrade your MT platform to build 616 or greater, the compiler executable will be deleted. Then when you build with VTS, VTS will prompt you to locate the file – which of course is missing.

For now, please download the file from this location and install it in your MT folder:

Here is a link to the original MT post (it’s in Russian):

MetaQuotes states these locations will always have the latest compilers.

In the next VTS release, I think I will bundle the MT compiler with VTS. That way, you will not have to bother with the additional download.