My trailing stop doesnt work the way i intended to

Hi guys, so this code below is my trailing stop which is chandelier stop. but what i want is to trailing stop not to drop when the price is dropping. I want the trailing stop to stay when the price is dropping (See purple line). Can anyone fix my code below? Many thanks! sorry if my english is bad



ATRRange = Param("ATRRange", 2,1,60,0.5);

ATRMult = Param ("ATRMult", 1.5, 0.5,10,0.1 );

ExitPrice = C - ATRMult*ATR(ATRRange);

LastExitPrice = HighestSince(Buy,ExitPrice,1);

Sell = L < LastExitPrice;


@Rashif if you search this forum it has probably been discussed half a dozen times. The implementation of a Chandelier stop is in the User Guide (scroll down to examples)

If you want to use different price levels for adjusting your trailing stop there is a Knowledge Base article,

And of course the Chandelier stop is also all over the internet, and a video presentation,