Optimal control for buy / sell / hold with fixed cost

116 Views Asked by At

Consider the economic optimisation problem connected with stock. We can buy (open long position), sell (open short position), close or do nothing. What is optimal (maximizing profit) control algorithm for trading (buy, sell or hold/wait) if we have known series of prices ($p_1, p_2, ..., p_T$)? Each opening of position requires fixed cost $J$. Each position has the same size. We can have only one position open at the moment. We can close and open position at the same time. I don't know is it good idea to model it using dynamic programming. Without costs problem is easy. Buying / selling in local supremum is solution. But using cost problem becomes more complicated.

1

There are 1 best solutions below

4
On

Better. Two points: (1) dynamic programming is not a model, it is a solution method for problems in optimal control. (2) Your problem is a problem in discrete optimization, not in optimal control. Namely, something like this:

Let $A$ be the constant size (amount) of a position; i.e., the amount of shares to be bought or sold (if I understand correctly).

Find a vector $(a_{1}, a_{2}, \ldots, a_{T})$ of actions, where each action $a_{k}$ is one of the four possible actions:

{ $OL$ (open long), $OS$ (open short), $C$ (lose), $SO$ (stay open), $SC$ (stay closed) },

with the objective of maximizing: $$ \sum_{\mbox{ all } a_{k} = OL} ( -J - p_{k} A) + \sum_{\mbox{ all } a_{k} = OS} ( -J + p_{k} A), $$ and subject to the constraints:

  1. $a_{1} \neq $ $SO$ or $SC$.

  2. If $a_{k} = C$, then $a_{k-1} = SO$ or $OL$ or $OS$. (A position can be closed only if previously opened.)

  3. If $a_{k} = $ $OS$ or $OL$, then $a_{k-1} = SC$ or $C$.

  4. $a_{T} = $ $C$ or $SC$.

I may not have understood all the details correctly, and did not address the simultaneous closing and opening of a position, but I hope this gives you the gist and convinces you that you have a MILP. Ping me if you need more detail.