[SQ 136Final] The value of useinitialstoploss has an unusually large impact on the results of the strategy backtesting

As you can see in the attachment, the backtest results change dramatically for the same strategy just by changing the useinitialstoploss value to force. There is a fixed profittarget of 160 pips in the strategy, but when useinitialstoploss =false, There are a lot of PT type transaction records in the tradelist, and the profit is -12.4. number of trades change to 2009.

And two different codes, I put them on MC for backtesting, but the results are very close.The final Netprofit is about 88000 whether useinitailstoploss is true or false.
I did a similar backtest on multiple strategies, and there was a huge difference in just this strategy, which is also very strange.Although I was confused, I probably thought that sq had made some mistakes.
PS: slippage=5 pips

Attachments
tradelist-PT-initialstoploss is false.jpg
(910.67 KiB)
data-minitue.rar
(4.65 MiB)
tradelist-PT-useinitialstoploss true.jpg
(957.42 KiB)
v.jpg
(132.81 KiB)
Strategy 16121.sqx
(63.84 KiB)
  • Votes +2
  • Project StrategyQuant X
  • Type Bug
  • Status New
  • Priority Normal

History

b
#1

binhsir

29.12.2022 13:47

Task created

b
#2

binhsir

05.01.2023 02:05
Voted for this task.
E
#3

Emmanuel

15.01.2023 10:09
Voted for this task.
b
#4

binhsir

17.01.2023 04:09
can you reproduce?
b
#5

binhsir

31.01.2023 15:17

This must be a serious bug.

1.By the way, in the source code, there are two variables IntLongSL,IntShortSL. but only one variable IntPT. The same variable is given different values twice in the code.

2. SetStopLoss((MinMove / PriceScale) * BigPointValue * IntShortSL); This code can actually be changed to SetStopContract; SetStopLoss_pt(IntShortSL); The same is SetProfitTargit_pt.  The code will look more concise and elegant in this way.


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