myRandom Expert Advisor

myRandom Forex expert advisor is my own experimental MT4/MT5 EA inspired by the seeming randomness of financial trading in general and the Forex trading. Of course, such approach goes astray with the dominant technical and fundamental analyses approach. But it can be considered as the only acceptable method for the believers in the random walk hypothesis.

This EA is very simple; it doesn't use any market indicators. The only condition it checks to decide the direction of the next position (buy or sell) is the random number - if it's an odd number EA goes short, if it's an even number EA goes long.

There are 6 input parameters to tune this expert advisor. Their default settings should be OK for the test GBP/JPY H1 chart, but you can toggle them as you wish to test your money management strategy as it is the only strategy that is applied to such random trading. Here is the list of the input parameters:

  • Lots — the number of standard Forex lots to open positions for.
  • Slippage — the acceptable price slippage.
  • RandomEntryPeriod — the number of bars the EA will wait to open a new position.
  • StopLoss — the stop-loss value in pips.
  • TakePorfit — the take-profit value in pips.
  • MaxPositions — the maximum number of the open positions at the same time. In MT5 version, this is used as the maximum volume of the position measured in Lots.

Warning! The latest backtest of this expert advisor on the period from 2006-11-19 through 2014-01-25 has shown a complete account wipeout.

Do not run this EA on a live account! Use for educational purpose only. The backtest results presented below are outdated.

Despite its seeming uselessness the random Forex trading proved to be profitable on the backtesting performed in the strategy tester. So, if you want to try something new and original myRandom EA is a good choice.

This EA is using a Magic number to track the number of currently open orders for the selected currency pair. So it's safe to trade with it on multiple currency pairs/timeframes in one account. You should be advised that this isn't true for the MT5 version. Not only it's slightly different from the MT4 one but it also may interfere with other EAs trading the same currency pair in the same terminal instance.

Testing myRandom expert advisor over a one year period showed almost $1,650 of profit on the GBP/JPY H1 pair/timeframe combination. The maximum drawdown was as low as $29. Testing its performance over the last three years also confirmed its stability.


What are the stop-loss and take-profit used by this EA?

It uses 90 pip stop-loss and 600 pip take-profit, without the trailing stop-loss.

How often does it trade?

On hourly GBP/JPY chart (the optimum settings) this EA will trade 6-7 times a month on average.

What's the difference between the versions for MT4 and for MT5?

Unlike the version for MT4, the one for MT5 trades without hedging and monitors only the maximum volume of the position, it also uses only one stop-loss and take-profit level for the whole such position.

This EA is ECN-compatible. You must set ECN_Mode input parameter to true in order to enable ECN-compatibility for this expert advisor. Otherwise, you will most likely be seeing OrderSend Error 130 messages when EA will be trying to open positions. This is because, if you are trading with an ECN broker (with market execution for orders), you cannot set SL/TP on position opening. You have to open a position first without SL/TP and only then modify it, adding stop-loss and/or take-profit level.


Download myRandom expert advisor for MT4

Download zipped myRandom expert advisor for MT4

Download myRandom expert advisor for MT5

Download zipped myRandom expert advisor for MT5


Warning! Before you ask basic questions regarding installation of the expert advisors, please, read this MT4 Expert Advisors Tutorial to get the elementary knowledge on handling them.

Do you have your own trading results or any other remarks regarding this expert advisor? Discuss myRandom with other traders and MQL programmers on the experts forums.

© 2005–2021

Design — Mart Studio

Forex trading bears intrinsic risks of loss. You must understand that Forex trading, while potentially profitable, can make you lose your money. Never trade with the money that you cannot afford to lose! Trading with leverage can wipe your account even faster.

CFDs are leveraged products and as such loses may be more than the initial invested capital. Trading in CFDs carry a high level of risk thus may not be appropriate for all investors.