Trades duration wrong

There is a bug about the trades duration. First i have selected to close all the position at the end of the day, so i wasn't expect trade with a duration more than 24 hours, but in the trade analysis tab when you select P/L Growth by duration in shows the majors trades under 24 hours and that's fine, but it shows some trades beyond the 24 hours, e.g. 4 days of duration. So i have tried to fix an exit mandatory after 20 bars maximum (i'm using M15 TimeFrame) so at max 5 hours, and the same bug appears, the major of trades closes in 5 hours, but the strategies show some trades that close in 2 days or more... 
I'm attaching the config file and a strategy and a pic to show you what i described 
Attachments
Duration BUG2.png
(143.23 KiB)
Strategy 07011.sqx
(48.47 KiB)
Buildduration bug.cfx
(21.56 KiB)
Duration BUG1.png
(134.81 KiB)
  • Votes 0
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

r
#1

RNG

16.07.2019 05:07

Task created

r
#2

Marcel

16.07.2019 07:28

Hello,


I think that's a problem with your data quality.


If your backtest is missing a candle because the data quality is bad, your strategy can't stop the trade until the next candle appears.


You use Dukascopy data, right?

This is unfortunately a typical problem with the data quality of Dukascopy...


h
#3

hankeys

16.07.2019 07:32
i think its OK


trade opened 30.3.2018, 16:15, closed 1.4.2018 21:00 duration 2d 4h


you are using EURUSD UTC0 data, so the last candle of day, or friday will be at 20:59, so your settings to close friday 22:00 is nonsense, in UTC0 data, there is no candle after 20:59, so the close will appear on the first othe candle, which will be sunday candle at 21:00...because of that the duration is longer :)

h
#4

hankeys

16.07.2019 07:34
its not a question of data quality...its a question of settings
h
#5

hankeys

16.07.2019 07:42
and the BASIC QUESTION is - will you be trading with broker with UTC0 or not? if not, your bactest is BAD


ALWAYS GENERATE ON DATA CLONED TO A BROKER TIME

r
#6

RNG

16.07.2019 18:38
I was wondering that the problem is the weekend gap, but i suppose that the software close the trades at the hour that i set up, also if there isn't bar candle. If is not this way, it's obviously like you said (hankeys), and the problem is in the settings of mine, however the developer team can add a message of warning if you set up a no sense closing time of the weekend, or better, an automatic closing market time.
TB
#7

Tomas Brynda

17.07.2019 08:46

Status changed from New to Fixed

Hi, 

Hankeys is right. If you set up some time to close and there is a gap at the end of a day, the strategy closes at the next bar. The trade can't be closed inside a gap, because it would behave differently than in a real trading. Our goal is 100% matching behaviour between backtest and real trading. 


We will think about adding some warning into UI when setting EOD time outside daily range of the selected data.


Best regards,

Tomas


Votes: 0

Drop files to upload

or

choose files

Max size: 5MB

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

...
Wait please