Python Dataframe generate trendline prices for future dates

I’m looking to forecast a trendline from a stock’s last pivot high or pivot low and store the trendline values in a pandas series. I’m looking to use this data to run a daily scan so that when the stock price closes above/below the trendline the scan will alert me. I’ve attached an image that shows a 45-degree trendline from the last pivot low of AAPL stock. I would like to be able to compute the trendline and store it in a table instead of manually drawing the lines on a chart.


enter image description here