I have a time series of prices and I am trying to create a trading strategy. I need to stop the trade as soon as the price_cap is met. I have data stored in a datab