Very Important: Change exit after bars policy

Assume we have an strategy that has an exit after bars. e.g. after 24 bars.

If at the moment that strategy should exit, VPS which strategy is running on, is off, (e.g. for update, lack of power, etc.) then when it is powered on again, the strategy won't exit the trade forever.
it seems you used such a thing for comparison:

  • if bar == exitAfter bar then exit
this should be changed to:

  • if bar >= exitAfter bar then exit
I encountered this problem frequently in MT5, but have not tried other engines.


Attachments
  • Votes +2
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

AA
#1

Alex

25.06.2023 07:20

Task created

TT
#2

Tamas

26.06.2023 10:53

Status changed from New to Fixed

Attachment image-0.png added

image-0.png
(462.26 KiB)
Hello Alex, I have checked that and it is correct in all engines. There is  >=



AA
#3

Alex

26.06.2023 11:41

Attachment 1.png added

Attachment 2023-06-26.png added

2023-06-26.png
(26.34 KiB)
1.png
(47.57 KiB)
See attachment:

This strategy has a exit after 70 bars.

It's H1, So it means near 3 days.

Today is 2023-06-26.

Order is opened at 2023-06-20 !


Also it is not just limited to this strategy.

I encountered this problem frequently.

It seems if at the point that strategy should exit, server is off, then exit does not work.

TM
#4

tmatejka.

27.06.2023 14:12

Alex,

we have tested multiple strategies with ExitAfterBars enabled and in all cases trades were exited correctly even after MT5 was switched off and started up later.

If you want us to further test please describe as much details as possible how it happened on your side and please attach the strategy (both sqx and mql files)

AA
#5

Alex

02.08.2023 09:09
Hi, Have you checked it?
TT
#6

Tamas

02.08.2023 09:14
I will ask Tomas Matejka to look into it :)
FB
#7

TROBO

02.08.2023 09:17
Voted for this task.
TM
#8

tmatejka.

15.09.2023 20:10
I have tested multiple times across some of my installed MTs and was not able to reproduce the issue unfortunately. If you still experience the issue, you can share details with us
E
#9

Emmanuel

16.09.2023 13:45
Voted for this task.

Votes: +2

Drop files to upload

or

choose files

Max size: 5MB

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

...
Wait please