[b136 dev 1] MT5 engine differences. Missing trades in terminal for market entries plus inaccurate exits

PROBLEM #1

Some trades were missing in the MT5 terminal that are present in SQX. Every tick, real spread Ducas data. I'm testing specifically on GOLD. The missing trade days produced these logs in MT5:

2022.04.16 17:47:13.544 Core 01 2014.02.14 13:00:00   ---VERBOSE--- 2014.02.14 13:00 Computing Money Management for order -  Risk fixed % of account
2022.04.16 17:47:13.544 Core 01 2014.02.14 13:00:00   ---VERBOSE--- 2014.02.14 13:00 Computing Money Management - Smallest_Lot: 0.01000000, Largest_Lot: 100.00000000, Computed LotSize: 0.15000000
2022.04.16 17:47:13.544 Core 01 2014.02.14 13:00:00   ---VERBOSE--- 2014.02.14 13:00 Max money to risk: 100.53419000, SL:1304.79000000, Max 1 lot trade drawdown: 638.50000000, Point value: 100.00000000
2022.04.16 17:47:13.544 Core 01 2014.02.14 13:00:00   ---VERBOSE--- 2014.02.14 13:00 Based on its logic, the strategy tried to place market order at incorrect price. Market price: 1311.17500000, order price: 1311.18000000 (this is NOT an error)

It is a market order so why should this happen? It should put the order through anyways or try again immediately with updated prices. If we ignore the condition and just put the trade through with the following code then all but one of the missing trades start working in the terminal:


//---------------------------------------------------------------------------- bool checkOrderPriceValid(ENUM_ORDER_TYPE orderType, string symbol, double price, double marketPrice){    if(orderType == ORDER_TYPE_BUY || orderType == ORDER_TYPE_SELL){       if(sqDoublesAreEqual(marketPrice, price)){          return true;       }       else {          VerboseLog("Based on its logic, the strategy tried to place market order at incorrect price. Market price: ", DoubleToString(marketPrice), ", order price: ", DoubleToString(price), " (this is NOT an error)");          VerboseLog("Putting through anyways");          return true;       }    }        return checkStopPriceValid(orderType, symbol, price, marketPrice, "stop/limit order"); }



PROBLEM 2:
Some of the exits are inaccurate notice the trade in the screenshot 2014.04.04 buy in at 1299.258 is fine but the exit at 1301.787 is way off, it should be 1300.20 like in SQX.

Attachments
ReportTester-3000031465.html
(613.26 KiB)
Screenshot_3.png
(760.55 KiB)
bugged-Strategy 52551.sqx
(303.99 KiB)
  • Votes +9
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

b
#1

bentra

17.04.2022 00:57

Task created

b
#2

bentra

17.04.2022 00:59
Voted for this task.
DC
#3

anuffi

17.04.2022 01:13
Voted for this task.
Bt
#4

beetrader

17.04.2022 12:31
Voted for this task.
E
#5

Emmanuel

17.04.2022 13:24
Voted for this task.
IN
#6

altenburg90

18.04.2022 02:49
Voted for this task.
SF
#7

sebasfiorent

18.04.2022 15:45
Voted for this task.
g
#8

geektrader

18.04.2022 21:19
Voted for this task.
Dw
#9

Diwi

26.04.2022 16:06
Voted for this task.
Cc
#10

Cyber

28.04.2022 02:27
Voted for this task.

Votes: +9

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please