You didn't say what you were going to do with the result and so there are two answers.
First, if you do not care about the future and the only concern is to precisely match the data that happened, then you can always fit any curve by constructing a polynomial whose degree is equal to the number of data points. It will fit perfectly. It will be useless as anything other than a descriptor of prior points, but it will look just right. It will be a case of overfitting. There is a nice example of overfitting the presidential elections at https://stats.stackexchange.com/questions/128616/whats-a-real-world-example-of-overfitting .
Your model is clearly overfitting the data for any predictive purpose, but very close to the exact solution if you are looking historically. The reason you can tell it is overfitting is that it is that it is catching the wavelets. The wavelets are known to be purely random and without signal. The original article on this can be found at:
Slutzky, Eugen. The Summation of Random Causes as the Source of Cyclic Processes. Econometrica. 5(2). Apr. 1937. pp.105-146
If you are trying to predict an outcome and intend to use it, then you need to adopt Bruno de Finetti's Coherence Principle to get there in your underlying mathematics. This will restrict you to Bayesian Statistics. Non-Bayesian methods are never coherent.
To understand why there is a simple 250-year-old example from the Reverand Thomas Bayes himself. In this example, the Reverend Bayes imagines a billiards table where a ball is bounced around to arrive at a random point. The ball splits the table into region A and region B randomly. The probability that a ball will roll into an area is equal to the proportion of area that region has divided by the total area.
The ball is removed after its location is recorded. Then two billiards players shoot balls. If the ball lands in their region they win and if not they lose. The problem is nobody told them where their region is or if they got a point or not until after it is over. They don't know where to shoot. The first to six points wins.
The question that needs to be solved is the odds that player B will win, given that eight shots have been made and the score is 5-3 in favor of A. A needs one point to win and B needs three.
The Frequentist answer is $(3/8)^3.$ This corresponds to gambling odds of about 18:1. So if you were to use a Frequentist method, then if you were a bookie you should offer 18:1 odds that B will win.
The Bayesian answer is very different. The Bayesian solution asks two different questions. The first question is what do we know about the odds of winning before we saw the balls shot. Second, what is the set of probabilities that could have triggered the exact results that were seen and what are the odds that each of these probabilities is the one true probability?
First, the user of a Bayesian method would create a parameter $\theta$ and assign the probability $\theta=k,\forall{k}\in[0,1]$. Since all possible values are equally probable, the prior distribution of beliefs about $\theta$ should be that $\Pr(\theta=k)\propto{1},\forall\theta\in{[0,1]}$. There is a binomial likelihood, so its probability is $\theta^3(1-\theta)^5$.
The posterior density function is $504\theta^3(1-\theta)^5$. This is the summary of all possible parameters that could trigger a 5-3 position and the probability that this is the true parameter. We need a prediction, however. To do this we make a prediction over the entire density, which is to predict the probability of winning three out of three. The solution to this is to solve $$504\int_0^1\theta^3\theta^3(1-\theta)^5\mathrm{d}\theta.$$
The answer to this is $\frac{1}{11}$. The Bayesian solution would create 10:1 odds. The Bayesian would be correct and always would create the correct solution. The Bayesian solution is $E(p^3)$, while the Frequentist is $[E(p)]^3$. This is true for any Bayesian versus Frequentist process including regression.
You would use Bayesian model selection. You would create a model that said there were only one set of parameters such as $$\frac{x_{t+1}-\beta{x_t}-\alpha-\varepsilon_{t+1}}{\sigma}.$$ Then you would assume there was a break and you would model two series jointly, one right after the other. You would do this again for three, four and five and so on until you felt you didn't want to continue.
As you increase the number of possible breaks, Bayes theorem will begin penalizing you for the added structure. At the same time, since it fits better, Bayes theorem will reward you for the improved goodness of fit. The model where the penalties are small and the rewards are high will end up with being the best fit model. If you want to do a prediction, then you will use the Bayesian posterior predictive distribution as we did to calculate the odds.
Because there is no prebuilt tool for this, you will have to build your own. If you have not used a Bayesian method, begin with William Bolstad's Introduction to Bayesian Statistics, 3rd edition. Definitely get the third edition as it is a huge improvement.