Has the problem of finding the most profitable transactions given a set of discrete time series been well-studied?
This can be solved using dynamic programming.  Note that the optimal solution never requires holding more than one type of stock at a time; if you sell a stock, then you might as well sell all of it, and before buying a stock you should sell all existing stock.  This enables a nice solution using dynamic programming.

Here are the details.  Let $A[i,s]$ denote the maximum value of your assets that can be achieved by the end of year $i$, denominated in dollars, if you are holding stock $s$ at the end of year.  Then there is a simple recursive expression for $A[i,s]$ in terms of the values of the form $A[i-1,t]$, based on the idea that either you sell or buy at the start of year $i$:

$$\begin{align*}
A[i,s] = \max(&amp;A[i-1,s] V[i,s]/V[i-1,s],\\
            &amp;\max \{(A[i-1,t]/V[i-1,t] - C) V[i,s] : t \ne s\}),
\end{align*}$$

where $V[i,s]$ denotes the price/value of stock $s$ at the end of year $i$ and $C$ denotes the fixed transaction cost.  Now you can compute these values iteratively, by first computing $A[1,\cdot]$, then $A[2,\cdot]$, and so on.  You can also keep track of which choice was optimal at each step and thereby reconstruct the sequence of transactions as well if you like.