Popular Posts

Editor'S Choice - 2019

MQL5: Writing an Advisor on Martingale

Dear colleagues, friends Forex traders, hello!

It is no secret that an adviser written using the Martingale algorithm can give good profit, and it can also be used to disperse a deposit. But where there is high profit, there are high risks, let's not forget about it, in addition, there are some rules for working with such experts. You can read more about the system and the rules of safe operation in the article “Safe Martingale”.

So, in this lesson we will learn how to write a Martingale Expert Advisor in MQL5.


  1. In order to minimize loss, add StopLoss to the EA.
  2. Add a time limit to the EA. For example, an expert opens positions at night, and only tries to get out of the drawdown in the daytime by averaging.
  3. I suggest changing the conditions for entering the market and use the Bollindger Bands indicator. Enter sales when the price crosses the upper boundary of the channel and into purchases when the price crosses the lower boundary of the channel.

And who knows, maybe in the aggregate of these improvements it will be possible to get a stable profitable system 😉

Previous MQL5 Lessons:

Watch the video: MQL5 TUTORIAL - SIMPLE POSITION MULTIPLIER (November 2019).

Leave Your Comment