- creat a function to defind how much you can get from 1 pip , due to your entry lotsize
- creat another function to defind how many pips you gain or loss from your equity
- and that by your pips-gain-from-equity function you will know how many pips far from current price to mark as a new sl
but this will more difficult if you trade more than 1 order at a time
hope this idea helps you
