B129: Optimizer allows strategies with trading issues

As per the title - strategy optimizer allows strategies with trading issues. Every strategy in the screenshot has huge numbers of trades closing at the same bar and a large majority of these trades are 0 seconds long.
Attachments
Optimiser Issues.png
(731.32 KiB)
  • Votes +1
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

JK
#1

Insanity82007

19.08.2020 09:24

Task created

JK
#2

Insanity82007

19.08.2020 09:24
Voted for this task.
JK
#3

Insanity82007

19.08.2020 09:26

Attachment Time in trade.png added

Time in trade.png
(340.30 KiB)
Time in trade = 0s screenshot attached
h
#4

hankeys

19.08.2020 11:35
are you building holy grail or want to loose the money? profit factor 18 and RDD almost 200 :) 2 pips SL scalper, really?


these strategies will not work


what precision are you using - 1M should be OK, but it seems that this is only selected TF only


and info about that your trade is closing on the same bar is not an issue - its only information that with selected TF only you will not know, if your SL or TP was hitted first

JK
#5

Insanity82007

19.08.2020 12:29
hankeys of course these strategies won't work. That's the ENTIRE problem I've got! 


This is based on a 4H timeframe and I most definitely DO NOT want a SL of 2 pips. With a stop loss of 2 pips, this is why the trades are closing on the same bar. For some reason, no matter what I set the weighted fitness criteria to, I have the issue that the optimiser is causing these silly trades and accepting broken strategies.  

JK
#6

Insanity82007

19.08.2020 13:07

Attachment TradesGreaterThanSameBar.java added

TradesGreaterThanSameBar.java
(1.59 KiB)
I created this snippet as a databank column to include in the weighted fitness calculation for the optimizer to solve the issue and it's working REALLY well. The only issue I have is that it's limited to the 4H timeframe and I would appreciate some help from the SQ wizards to collect the appropriate timeframe for a strategy.


This also won't work if the Precision is set to 1 minute tick data simulation, only if it's set to Selected Timeframe and I need help solving this too.


Thanks :)

JK
#7

Insanity82007

30.08.2020 14:06
It seems that the "Ambiguous Trades" column does the trick. Please ignore my request for help with the script above. 
It would still be good though in the optimizer to have the option to filter out optimisation results that have trading issues.
TB
#8

Tomas Brynda

15.09.2020 09:58

Status changed from New to Fixed

Hi,

the zero-duration trades are not a problem when you are testing with SelectedTF precision. It just means the trade was opened and closed in the same bar.

But in case of H4 the trade could have been opened for example for 3 hours. The time in trade can't be calculated properly when using this precision as backtest engine is given O,H,L,C prices with the same time for each bar.


I am closing this task.


Best regards,

Tomas


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