Different results with MT4 for the same data
I exported the history data from my MT4 application and used them as data input for backtader.
My test strategy is trivial: Buy/Sell when two MAs cross over. The same simple algorithm is implemented in backtrader and MT4 and applied to the same data.
The results which I get using MT4 and backtrader are not same: sometimes the buy/sell operation is executed in the same time on both platforms but sometimes not (more often).
Does anybody have similar experience? What could be the reason?
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
Limitorders 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
Marketorders and that MT4 lets you buy the
closeof 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
closeof 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-closein the backtrader broker. All assuming the educated guess is not educated and not a guess.
Thanks @backtrader ! I will provide the code samples and history data as soon as I find a time.