Came across a youtube video that I thought would be perfect to test with my limited skills lol

I am stuck setting up the stop loss and take profit. What would be the best way to implement a stop loss that looks back at an “x” amount of candle-bars and picks the lowest low of all candle-bars? while at the same time comparing the current price of the underlying and set stop-loss and multiplying this by x1.5 for the take profit.

Video incase I wasn't clear: 

Author