Friday, March 5, 2010

Meta-Trader - Revealing hidden indicators

Welcome back Meta-Trader fans.

Most commercial expert advisor attempt to hide or obfuscate their logic to make it more difficult to figure out how they work. And this makes perfect sense because if the logic of an EA were widely available, any money making edge using the EA had would soon be lost.

A commercial Expert Advisor is distributed to the buyer as an ex4 file, which is a file compiled from the original code written in the MT4 language. Some of the reasons ex4 files, rather than mq4 files, are sold include the fact that ex4 files run more efficiently than mq4 files, ex4 files cannot be changed/damaged by the user without very specialized knowledge and techniques, and because the developer would likely want to keep the logic of the EA secret as long as possible. Even with ex4 files, it is still possible to get broad hints about the way the EA works if, during backtesting, the indicators are displayed in the backtested charts. However, many developers have found other ways to hide the indicator 'secrets' of their EA's. One way is through the use of the MT4 function 'HideTestIndicators(TRUE)'.

After back-testing an Expert Advisor, you can click on the "Open Chart" button to see a historical chart showing the entries and exits for the back-test period. Normally, the indicators used by the Expert will be drawn in the bottom of the window as shown above. The obfuscation comes if the EA developer calls the HideTestIndicators() function to prevent the indicators from appearing. If you have the decompiled ex4 file (ie. an mq4 file), and you understand the MT4 language, you can examine the source code and find any indicator functions. Even more easily, you can find calls for the HideTestIndicators() and simply comment them out.

Then back-test the EA, click on the 'Open Chart' function, and voila, the hidden indicators are revealed. As an example, we can see that one of my favorite scalping EA's makes use of the CCI (Commodity Channel Index) and the RSI (Wider's Relative Strength Index) both on 15-minute bars. We can also notice that one or both of those 2 lines are heading down when a buy is triggered, and heading up when a sell is triggered.

In fact, I believe that some of the geat scalping EA's, including EAKAIN and Megadroid use this sort of sort of indicator logic - buy when the indicators say things are getting oversold, sell when the indicators are saying things are getting overbought. There are a number of other conditions also regarding time of day, and daily range before conditions are put on.

Once the EA takes a position, the position is exited once the profit target is hit (10 pips), or the stop-loss is hit (40 pips) or after one hour time out, EA will exit at break even or any profit if CCI and RSI are back above their midpoints, 0 for CCI and 50 for RSI.

Thanks for reading and more to come.

3 comments:

  1. This is very usable information about Forex Robot. Thanks for share this important information about Forex Robot and Top Forex Product. I also get a very interesting information about Forex Robot Evolution on a site.

    ReplyDelete
  2. I always prefer to read the quality content and this thing I found in you post. Thanks for sharing. A very good resource for everybody that wants to read a good blog.

    Buy Gold Coins In San Francisco

    ReplyDelete