What I like to do is use Variables to control stuff like this.
Create a Variable "STOPLOSS" with value "0".
Then you use pink blocks "For Each Closed Position" -> "Check How it Was Closed" and then the gray block "Modify Variables" to change your variable to "1".
So when a trade is closed as a Stop Loss, your Variable "STOPLOSS" that was "0" is now "1". This is your Flag.
Then you can have another set of blocks like a simple "Pass" -> "Condition" -> "Delete pending orders", where you check if you variable "STOPLOSS" is "1", if it is, your pending orders are deleted. Then you connect another "Modify Variable" after "Delete pending orders" to change your "STOPLOSS" back to "0", so you reset your logic.
It sounds kind of complicated, but after you get the hang of if, you can do a LOT of stuff using this strategy. Here is a quick example:
https://fxdreema.com/shared/2vqEYLMte