Discussing the article: "Per-Setup Trade Ledger in MQL5: Find Out Which of Your EA's Entries Is Losing Money"
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
Check out the new article: Per-Setup Trade Ledger in MQL5: Find Out Which of Your EA's Entries Is Losing Money.
I ran my liquidity-sweep scalper over eight months of USDCAD M1, from the first of January to early September. It closed 1,365 trades and gave back roughly two-thirds of a 10,000 USD account. The Strategy Tester summed it up in one line: profit factor 0.88, net loss 6,838.22 USD.
That line is true and almost useless. The EA trades two setups, a bullish order block after a swing low gets swept and the mirror image of it on the sell side. Same entry code, same risk model, same magic number, so as far as the tester is concerned it is one system. It isn't. When I finally split the trades by setup, 82% of the loss came from the bullish side alone. The bearish side lost money too, but less than a quarter as much. I had spent two weeks optimizing inputs that applied to both.
That is what this article fixes. CSetupLedger is a small class that keeps a separate record for every setup type in an EA. It rebuilds itself from the account's own deal history, so a restart or a deleted file doesn't wipe the record. Next to the raw win rate it prints a Wilson score interval, which answers the question I kept asking during testing: has this win rate earned any trust yet, or is it still three lucky trades? Then it compares that interval with the breakeven win rate implied by the setup's own wins and losses. How often a setup wins does not tell you, on its own, whether its trades were worth taking. What comes back is one of four short answers instead of a percentage you have to interpret: too few trades, undecided, trusted or rejected.Everything below comes out of code that runs, and the files are attached at the end of the article.
Author: Ali Akbar