Discussion of article "Step-by-Step Guide to Writing an Expert Advisor in MQL5 for Beginners" - page 31
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
First I would like to say that I read this article and I copied the code because I wanted to learn MQL5 coding. Second I feel I learnt a lot, and I have written 7 EAs now and a few indicators. So I feel I am well on my way to learn it to such a degree that I can code my own ideas.
Furthermore. I got really curious about the strategy tester. First I thought it was just too basic, and that it could never work. That is not true. It can work. However. For my sake it worked only for people with enormous patience. So I tested it on USDCAD, daily timeframe and I optimized take profit, stop loss and ADX period. The short story is. Just put ADX in the middle. Above 29 and below 60. You will be fine. Take profit. Quite much as high as possible. Between 300 and 500. Stop loss. For sure a lot less. A recurring number was either 155 or 30. Then comes the big problem. I tested it from 2019 until early 2025. It gave from 75 trades till about 45 for the highest ADX settings. I looked at the graph from 5 of these tests. It hovers around 0 until 2024. Then all the gain comes in the last year. Profit factor I looked at was from 1.77 till 2.61. A lot of problems all over. All shorts were losses. 86% of longs were profitable. A lot of trades had a long duration. A lot more than 10 days in general. I think I saw 3440 hours as longest holding time. Average was 846 hours. Payoff could also get very high I felt, but who wants to be limited to less than 20 trades after 6 years?
I spent days getting through all 33000 combinations. Now I will test further and reduce the tasks a lot. I don't need ADX values above 55. Stop loss at 30 is just too low even if I have seen a lot of profitability with that too. As a last point. I read one can connect several PCs/laptops in a LAN to increase speed. I recommend that.