Stop loss in % of current amount instead of a fixed rigid value

There should be a feature to set the percentage of amount you are willing to lose, which should be calculated on the current balance + profit.
For example I should be able to set 10% stop loss

  1. Bought 50 shares of 10 each
  2. Set stop loss at 10%
  3. Made 5% profit
  4. Now if (50 x 10 + 5% profit) should go 10% down I want to sell all the shares or number of shares
    and then there should be an option to rebuy the stock if it drops few percent from a base amount which could be the current or any value.

Please like if you guys like my idea. (English is not my first language sorry for any problem regarding my grammar etc)