@didymario7 What is in the link will set the variable every time a new order is placed, think will only change if buy is added, as long as the last order placed is the one you want to replace it's all good.
@didymario7 Can you please confirm then that the lost size evolution is finally fixed?
On the other hand, I don't see the logic behind that variable trailing stop. Why is it supposed to work in the first one only? This is not how martingales work.