I found a incredible common sense error in MT5 tester.

 
I find a common-sense error, in MT5 tester.
when I test a EA from market, I found its profit caculation is very wrong. It just a common-sense error.
I am testing a EA with modeling "every tick based on real tick".

I check journey of tester generated. tester developer of MT5 misunderstand buy and sell's open price and close price.

please check log message below:
======BUY order=====
CO 0 17:56:36.781 Core 01 1993.01.06 05:00:00   market buy 0.05 AUDNZD1 (1.06866 / 1.06849)
JH 0 17:56:36.781 Core 01 1993.01.06 05:00:00   deal #2 buy 0.05 AUDNZD1 at 1.06849 done (based on order #2)
FI 0 17:56:36.781 Core 01 1993.01.06 05:00:00   deal performed [#2 buy 0.05 AUDNZD1 at 1.06849]
FO 0 17:56:36.781 Core 01 1993.01.06 05:00:00   order performed buy 0.05 at 1.06849 [#2 buy 0.05 AUDNZD1 at 1.06849]
...
LP 0 17:56:36.781 Core 01 1993.01.06 05:09:22   take profit triggered #2 buy 0.05 AUDNZD1 1.06849 sl: 0.96849 tp: 1.06903 [#3 sell 0.05 AUDNZD1 at 1.06903]


=====sell order====
FE 0 17:56:36.781 Core 01 1993.01.06 09:00:00   market sell 0.05 NZDCAD1 (0.92163 / 0.92138)
MP 0 17:56:36.781 Core 01 1993.01.06 09:00:00   deal #4 sell 0.05 NZDCAD1 at 0.92163 done (based on order #4)
MM 0 17:56:36.781 Core 01 1993.01.06 09:00:00   deal performed [#4 sell 0.05 NZDCAD1 at 0.92163]
PD 0 17:56:36.781 Core 01 1993.01.06 09:00:00   order performed sell 0.05 at 0.92163 [#4 sell 0.05 NZDCAD1 at 0.92163]
...
HP 0 17:56:36.781 Core 01 1993.01.07 14:07:12   take profit triggered #4 sell 0.05 NZDCAD1 0.92163 sl: 1.02163 tp: 0.92094 [#12 buy 0.05 NZDCAD1 at 0.92094]

let check BUY order, every time, EA will receive two price squote when market updated.
(1.06866 / 1.06849)
To make discussion clear, there two values. I call them "HIGH" and "LOW".

if you place an buy order manually in market, everytime price of the open position is the HIGH price.
and when you close an buy order, its close price will be LOW price while you closing position.

To sell order, vice verse, for opening sell order, LOW price is the price of open position, and HIGH price is the close price for this sell position.

But in above log, it made mistake about open price and close price. Above buy order, it use LOW as open price and treat HIGH as close price.

This is totally very very wrong. 

This mistake will make tester calculation profit of each order far more large than it should be. and reduce loss of each order than it should be.

And I do found final test result will be calculated based on these wrong open and close price.
This will mislead investor a lot. Make those bad EA looks like profitable.

PLEASE fix this tester's BUG.

 

There is nothing wrong and there is no error. There is no bug!

It is called "Ask" and "Bid" (not "high"/"low"). It is normal, and it is known as the "spread".

That is how it works in trading and almost every single market and symbol.

  • A buy position opens at the Ask price and closes at the Bid price.
  • A sell position opens at the Bid price and closes at the Ask price.

I suggest you take some time to research this and how trading works.

Also, please don't post randomly in any section. Your topic has been moved to the section: Expert Advisors and Automated Trading

 

Basic Principles - Trading Operations - MetaTrader 5 Help

...

A deal is the commercial exchange (buying or selling) of a financial security. Buying is executed at the demand price (Ask), and Sell is performed at the supply price (Bid). A deal can be opened as a result of market order execution or pending order triggering. Note that in some cases, execution of an order can result in several deals.

...

Chart Settings - Additional Features - Price Charts, Technical and Fundamental Analysis - MetaTrader 5 Help

...

  • Show Bid price line — show/hide the Bid price level of the latest quote. A horizontal line corresponding to the Bid price of the latest quote appears on the chart.
  • Show Ask price line — show/hide the Ask price level of the latest quote. Bars in the platform are formed based on Bid prices (or Last prices if the depth of market is available for the instrument). However, the Ask price is always used to open long positions and close short ones. The Ask price is not displayed on the chart, so it cannot be seen. To have a more precise control over trading, enable the "Show Ask price line" parameter. An additional horizontal line corresponding to the Ask price of the latest quote appears on the chart.

...

 
Fernando Carreiro #:

There is nothing wrong and there is no error. There is no bug!

It is called "Ask" and "Bid". It is normal, and it is known as the "spread".

That is how it works in trading and almost every single market and symbol.

  • A buy order opens at Ask price and closes at the Bid price.
  • A sell order opens at the Bid price and closes at the Ask price.

I suggest you take some time to research this and how trading works.

Also, please don't post randomly in any section. Your topic has been moved to the section: Expert Advisors and Automated Trading

Man, please check it carefully. Don't be  dogmatic.

I check it 20 times. I am 100% sure I am right.


FORGET ABOUT ASK/BID, to make things simple.

When Every tick arrive,  we get two prices of quote. one is HIGH AND other one is LOW.

OBVIOUSLY, if you place market BUY order, then your price of the BUY order, must be the HIGH one.

And after some period, when you close this BUY order, your close price MUST BE the LOW price of tick when you closing this BUY order.


if I am wrong, the LOW one is open price, and HIGH one is close price.

THAT WILL CREATE A VERY INTERESTING SCENARIO. 

TO MAKE MONEY, WE JUST NEED TO OPEN BUY ORDER AND CLOSE IT IMMEDIATELY, AND REPEAT THIS PROCESS AGAIN AND AGAIN. 

Then all of us will be rich within HOURS.

 

If you don’t understand this, then I have nothing to say.

 

 

Questions:

  1. Are "AUDNZD" and "NZDCAD1" custom symbols or broker supplied symbols?
  2. What build of MetaTrader 5 are you using?

I ask this because your journal log show that the Ask/Bid prices are switched. It is supposed to print "( Bid / Ask )" but in your log it seems to is show "( Ask / Bid )".

Here is an example ...

2023.05.22 03:23:28.134 Core 1  2022.01.12 17:45:57   market sell 0.1 AUDNZD (1.06363 / 1.06383)
2023.05.22 03:23:28.134 Core 1  2022.01.12 17:45:57   deal #1239 sell 0.1 AUDNZD at 1.06363 done (based on order #1239)
2023.05.22 03:23:28.134 Core 1  2022.01.12 17:45:57   deal performed [#1239 sell 0.1 AUDNZD at 1.06363]
2023.05.22 03:23:28.134 Core 1  2022.01.12 17:45:57   order performed sell 0.1 at 1.06363 [#1239 sell 0.1 AUDNZD at 1.06363]
2023.05.22 03:23:28.134 Core 1  2022.01.12 17:50:57   market buy 0.1 AUDNZD, close #1238 (1.06352 / 1.06372)
2023.05.22 03:23:28.134 Core 1  2022.01.12 17:50:57   deal #1240 buy 0.1 AUDNZD at 1.06372 done (based on order #1240)
2023.05.22 03:23:28.134 Core 1  2022.01.12 17:50:57   deal performed [#1240 buy 0.1 AUDNZD at 1.06372]
2023.05.22 03:23:28.134 Core 1  2022.01.12 17:50:57   order performed buy 0.1 at 1.06372 [#1240 buy 0.1 AUDNZD at 1.06372]
By the way, I am using the latest official release build 3661 (anything higher than this is a beta build).
 
Fernando Carreiro #:

Questions:

  1. Are "AUDNZD" and "NZDCAD1" custom symbols or broker supplied symbols?
  2. What build of MetaTrader 5 are you using?

I ask this because your journal log show that the Ask/Bid prices are switched. It is supposed to print "( Bid / Ask )" but in your log it seems to is show "( Ask / Bid )".

Here is an example ...

By the way, I am using the latest official release build 3661 (anything higher than this is a beta build).

ok, let me check

 
owisob #: ok, let me check

One more thing, is this a broker account (real or demo) or a MetaQuotes demo account?

 
Fernando Carreiro #:

Questions:

  1. Are "AUDNZD" and "NZDCAD1" custom symbols or broker supplied symbols?
  2. What build of MetaTrader 5 are you using?

I ask this because your journal log show that the Ask/Bid prices are switched. It is supposed to print "( Bid / Ask )" but in your log it seems to is show "( Ask / Bid )".

Here is an example ...

By the way, I am using the latest official release build 3661 (anything higher than this is a beta build).

I was played by Tick DATA SUITE. it export price with wrong ask/bid position.

Thank you, man.

Reason: