Backtesting To Exit At Peaks Or Near Peaks

Hello Team,
I am trying to perform a backtesting.

The issue is for example there is a short position, it reaches the minimum value and then retraces upwards.

I want the exit/profit book to be marked at the minimum level or maybe retracement to 0.25% of the profit made.

Currently the system exits at the end of the day value, and marks a minor loss.

The two points for entry and profit booking is marked.

image

image

image

How to tweak these settings to exit at the point when it is minimum + retracement of 0.25% from low seen

This is called trailing, so you need to work on how you will trail the trades and move the stop accordingly.