Modify supertrend strategy in Pine script

Job ID: 33310413

Budget: €8 – €30 EUR

Hi, I have a strategy based on supertrend and I need to add a take profit rule:
-first target: R/R 1:1 close 50% of the position and breakeven on entry point
-second target: 50% when condition of entry in the opposite direction occur
Thanks
Related categories: Pine Script