[124] Breakeven is activated when it shouldn't

I was replicating Multicharts strategy in backtrader.
I have an issue with Breakeven stop loss.
When I disable Breakeven stop loss I get perfect match.

I can't replicate a trade that closes using Breakeven stop loss at 8th of February 2017 11:00:00.

To close at 11:00, strategy places orders at previous bar - 10:00
As I understand stop order is replaced every bar.
In my replication last time Breakeven gets activated is at 09:00
At 10:00 Breakeven don't get activated and standard stop loss order is placed instead.
But in StrategyQuant trade is closed at Breakeven,  I don't get how it can happen.
Probably a bug in StrategyQuant.

Here is the data I have:

PriceLevel = 3.8 * SQ_ATR(74)[1]

2017-02-08 09:00
SQ_ATR(74)[0] = 5.464436991639985
PriceLevel = 20.861913452728277
Entryprice = 1037.0
Close = 1065.9
Close - PriceLevel = 1045.0380865472719
Entryprice <= Close - PriceLevel = True
Breakeven got activated

2017-02-08 10:00
SQ_ATR(74)[0] = 5.564917572834041
PriceLevel = 20.764860568231942
Entryprice = 1037.0
Close = 1055.1
Close - PriceLevel = 1034.3351394317679
Entryprice <= Close - PriceLevel = False
Breakeven didn't get activated

Attachments
No attachments
  • Votes 0
  • Project StrategyQuant X
  • Type Bug
  • Status Refused
  • Priority Normal

History

KP
#1

CooleRnax

14.11.2019 03:47

Task created

KP
#2

CooleRnax

14.11.2019 03:48

Attachment 123.sqx added

KP
#3

CooleRnax

27.11.2019 12:53
Solved found an issue on my side
MF
#4

Mark Fric

27.11.2019 15:08

Status changed from New to Refused


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