Need assistance with a stop loss mechanism

Hello everyone, I hope I’m in the right spot for this.
I want to store multiple stop loss levels 3.5 points, 5 points, and 10 points in the code without activating them right away. For instance, if my entry candle drops sharply and goes beyond the 3.5-point stop loss, I get an error because the stop loss is above the market price. To fix this, I’d like the code to cancel the 3.5 point stop loss and move to the 5-point stop loss. The code should track the price during the candle, and if it passes the 3.5-point level, it should switch to the 5-point stop loss and set it there. I hope this explanation is clear; if not, I’ll clarify further. I’ve been trying to solve this for weeks without success. Any guidance would be greatly appeached or a code example how it can be coded.

Thank you.

One thing you could do is simply monitor price and have your levels as doubles. If price reaches or passes your 3.5 point stop you could enter a market order at that time. That would eliminate the error portion, but depending on when the trade is entered you may enter really late. How are you using OnBarUpdate, with OnBarClose, OnPriceChange or OnEachTick? If you are doing something that doesn’t change as often like OnBarClose, you could check how far price has gone before figuring out which stop loss you’d want to use.

How are you currently doing it? When are you trying to set the 3.5 point stop loss in relation to what price is doing?