MQL5 TUTORIAL – Christmas Edition Part 9

 

Trade the system yourself with Metaquotes demo accounts: https://swiy.co/RobotTrading

 

Okay, let’s take a look at how the system works here. We have an equity, which is the net balance. This is always reduced when we open a position, because every position is initially in the red. We also have the balance, which is the gross balance. And the gross balance always increases when we make a profit and there are currently no open positions. For example, right now our gross balance has increased by €10 and we have no open position because our oscillator is between these two lines.

 

Now it is below the lower line, which is a buy signal, and if we are in an uptrend, a position will then be opened. Whether we have an upward or downward trend can be seen quite well with the help of these moving averages here. And now let’s speed up the whole thing and let it run for a while. Then we see how many positions our system automatically opens and closes. Here in the strategy test, there is the so-called history. There you can see the opening and closing of the position for each individual position. The “Operations” tab works in a similar way and the journal is always interesting, because this is where we would also see if errors occur. For example, a calculated value may not work because the broker has defined that the stop loss must not be so close to the purchase price, or there could be requotes or problems with the margin.

 

We would see all these errors here. Our system is trading peacefully all the time and we have now reached €9,636.00. What the strategy tester does not show is the historical curve. We can see that here in MetaTrader 5 itself. You can display the chart and it shows us how our Expert Advisor behaves over the course of our set trading period. All in all, we have a positive result here and now, of course, the question arises: can I improve this result? And if so, how would I do it? To answer that, let’s change a few things and we’ll do it the other way around. We’ll try to find out what measures can be taken to ruin a system immediately.