A real (as real as possible) diagnostic could be attempted if at least a couple of data samples and buy/sell operations were provided. And furthermore if you use
Limit orders for example.
A code sample would be even more helpful.
In any other case one can only make an educated guess.
The educated guess assumes you use
Market orders and that MT4 lets you buy the
close of the bar you are evaluating. Be it the case, that is unrealistic, because a bar which you see is already closed, and giving you the
close of the bar is giving you a price which is no longer available (it may become available later in a yet-to-be-delivered bar)
It can be a good approximation. Such a behavior can be enabled with
cheat-on-close in the backtrader broker. All assuming the educated guess is not educated and not a guess.