After a little
If you aren’t acquainted with concept of the
In short, the
The expert advisor is available only for MetaTrader 4, because I still have a lot of issues with the MetaTrader 5 order handling. Because it’s not profitable, I didn’t add it to the list of MT4 EAs on my site.
How to use it:
- Download and copy to your MetaTrader’s /experts/ folder.
- You’ll need to create a
map-file with the market “knowledge” for EA. - Open the EA in MQL Editor and comment out lines 59 and 87–106.
- Compile it.
- Run it in a strategy tester on EUR/USD, H1, Open prices only, any period (the longer is the better).
- “rl.txt” file will be created inside /tester/files/ folder of your MetaTrader.
- Copy it to /experts/files/ folder.
- Open the EA in MQL Editor and uncomment lines 59 and 87–106.
- Compile it.
- You can now attach it to EUR/USD H1 chart. It will trade and continue learning. On deinitialization it will save its data to ”rl.txt” located in your /experts/files/ folder.
There are three known problems with this Forex expert advisor that make its use unprofitable:
- Basing the market knowledge on the OHLC patterns of the previous bars proved to be ineffective.
- If the market significantly changes its behavior compared to the period of learning, the EA fails to trade profitably.
- If the range of prices changes significantly, the previous data proves to be pretty useless.
Possible ways to improve this
- Find better market parameters to store as the EA’s knowledge (
Heiken-Ashi , various pivots, indicator values, etc.) - Provide better learning pattern — not just buy, sell or hold if the
Close-Open difference of the next candle after the pattern was inside/outside a certain range of pips. - Find better coefficient system to weight the older data compared to the newer.
- Add more maps with different data that can’t be compared with the data stored in the primary map (for example, a separate map for Volume data).
- Use other distance measuring method instead of Euclidean (Mahalanobis, Manhattan, Chebyshev, Minkowski, etc.)
- Find a different way of applying the distance — using the average distance, using the shortest distance, using the median distance, etc.
You can freely modify, upgrade and use the pieces of code from this EA as long as you leave the credit to the original author (me) inside the MQL file. If you manage to get something worthy out of it, please let me know.
If you have any questions or comments regarding this


April 18th, 2010 at 12:59 am
All that said is fine, but let’s not forget about other things that are important to take into account. Based on my experience, the Forex market is constantly changing and evolving so you want a software program program that changes with you. There are many software, you need to pick something that fits well with your knowledge and strategy and consider risk.
▼Reply
Andrei Reply:
April 19th, 2010 at 9:27 am
Yeah, that’s why such self-learning EAs are good. They are constantly learning as the market changes.
▼Reply