Why did Strategy take this trade?

You would need to look at the logic of your code and how it updates to figure out why it possibly isn’t working as intended.