[B135] Minus PT cause 'OrderModify error 4051', open orders at a very far price.

This is a backtest result on Metatrader4, USDJPY, H1.
The backtest data is imported by 'Data Manager', 'Export to MT4' function.


Error 1:
Minus PT cause 'OrderModify error 4051'


2003.06.18 13:00:14  Strategy 1.44.100 USDJPY,H1: - SQ LOG 2003.06.18 13:00 Modifying order with ticket: 41, SL: 1.41400000 and PT: -0.91300000
2003.06.18 13:00:14  Strategy 1.44.100 USDJPY,H1: invalid takeprofit for OrderModify function
2003.06.18 13:00:14  Strategy 1.44.100 USDJPY,H1: OrderModify error 4051


2003.06.18 14:00:00  Strategy 1.44.100 USDJPY,H1: - SQ LOG 2003.06.18 14:00 Modifying order with ticket: 42, SL: 1.45400000 and PT: -0.91200000
2003.06.18 14:00:00  Strategy 1.44.100 USDJPY,H1: invalid takeprofit for OrderModify function
2003.06.18 14:00:00  Strategy 1.44.100 USDJPY,H1: OrderModify error 4051


2003.06.18 15:00:25  Strategy 1.44.100 USDJPY,H1: - SQ LOG 2003.06.18 15:00 Modifying order with ticket: 43, SL: 1.49800000 and PT: -0.91200000
2003.06.18 15:00:25  Strategy 1.44.100 USDJPY,H1: invalid takeprofit for OrderModify function
2003.06.18 15:00:25  Strategy 1.44.100 USDJPY,H1: OrderModify error 4051


Error 2:
It opens orders at a very far price. Sometimes try to open at a minus price.


Current price is '118.338', but try to order with price -0.03500000
2003.06.18 08:00:00  Strategy 1.44.100 USDJPY,H1: - SQ LOG 2003.06.18 08:00 Opening order type BUY STOP with price -0.03500000. Current market prices: 118.33800000 / 118.33800000


Current price is '118.554', but try to order with price 0.03700000
2003.06.18 13:00:14  Strategy 1.44.100 USDJPY,H1: - SQ LOG 2003.06.18 13:00 Opening order type SELL STOP with price 0.03700000. Current market prices: 118.55400000 / 118.55400000


Current price is '118.466', but try to order with price 0.03800000.
2003.06.18 14:00:00  Strategy 1.44.100 USDJPY,H1: - SQ LOG 2003.06.18 14:00 Opening order type SELL STOP with price 0.03800000. Current market prices: 118.46600000 / 118.46600000

Attachments
log-clipped.log
(13.20 KiB)
Strategy 144100.sqx
(1.56 MiB)
  • Votes +1
  • Project StrategyQuant X
  • Type Bug
  • Status Waiting for information
  • Priority Normal
  • Assignee tmatejka.
  • Category Backend

History

HS
#1

NAPA

05.04.2022 17:51

Task created

E
#2

Emmanuel

07.04.2022 13:41
Voted for this task.
TM
#3

tmatejka.

12.09.2022 22:23

Status changed from New to Waiting for information

NAPA, did it work well for you on default broker's data? does the problem occur only on exported tick data?

please confirm

I have tested on the default data and it works correctly. no negative values and order are placed accordingly

HS
#4

NAPA

21.09.2022 13:10

Attachment 20220921.zip added

20220921.zip
(19.24 KiB)

Steps:

Generate a code by B136 Dev4

Install Metatrader4

Run backtest on the Real account.


Result:

There are many "OrderModify error 130", but there is no "OrderModify error 4051".

Because our broker doesn't supply the year 2003 data, I can't test it.

MF
#5

Mark Fric

14.11.2022 10:57

Milestone changed from Build 136 Dev 4 to Build 136 RC 1

TT
#6

Tamas

18.11.2022 11:16

Milestone changed from Build 136 RC 1 to Build 137

MF
#7

Mark Fric

04.04.2023 11:08

Milestone changed from Build 137 to Build 138

MF
#8

Mark Fric

08.12.2023 08:59

Milestone changed from Build 138 to None


Votes: +1

Drop files to upload

or

choose files

Max size: 5MB

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

...
Wait please