Learning MQL: Your First Martingale Advisor
Greetings, gentlemen, traders!
We continue our MQL4 lessons. And this time, we will write an adviser that will work on the Martingale system (popularly such robots are called "monkeys"). This will be a very simple expert who can serve as a basis for further research and development of your own “Grail”.
Using the knowledge that you acquired after this lesson, I ask you to modify the adviser as follows:
- Add the external MaxOrders parameter and modify the EA so that it does not open orders more than specified in this variable.
- Add the MaxLoss parameter, which will be responsible for the maximum allowable loss in points for the expert (be sure to consider volumes). In case this happened, close all open orders.
P.S. If you just joined us, start by looking at the previous lessons:
- Introduction to MQL
- Cycles, functions and orders in the adviser.
- We write an adviser on an external indicator