The indicator must trace distance (pips) from min and max during trends for
help to find the best trailing stop value.
in the example you can see the calculation (orange) that indicator make
during trend. (Note the negative value if the price go down).
I hope this can help. Ask me other information if you want.
The indicator can be developed with one curve that go positive and negative or, another version
, can have two curves (long and short);