# Is this an optimal stopping problem?

I am trying to work out how to approach a machine learning problem of 'learning' an optimal liquidation time/threshold, under some conditions, from historic data. The idea is a trader armed with this model will choose the right time to close an open position, to maximise his PnL over a large number of orders.

Consider a trader holding some position of shares $$X(t)$$ at time $$t$$ where $$X(0) = x_0$$. Price evolves as $$p(t)$$ and we assume shares were bought at price $$p(0) = p_0$$.

For now, we assume:

• Price follows geometric Brownian motion with zero drift and known variance.

• No market impact and infinite liquidity: the position is closed instantaneously at time $$t_c$$ where $$0.

• The full position is liquidated at once

• There is some finite end-time $$T$$ at which the trader is forced to close his position.

(Side-note: I think the problem generalises to optimal execution, if we include market impact and allow slices of $$X(t)$$ to be traded.)

The problem to solve is, what is the optimal time to trade?

I see a number of conflicting interpretations / solutions for this problem:

1. Trade at the best price after some fraction of $$T$$ has passed - following the secretary problem (i.e. optimal stopping)
2. Trade immediately (mean-variance optimisation with risk aversion)
3. Trade with zero/negative risk aversion; allow time to pass and close the position depending on some other metric (e.g. $$\operatorname{P} (p(T) > p(0) \,| \,p(t) )$$.
4. Trade at $$T$$, if we treat this as an American option without dividends

Side-note; if the answer is (2) or (3), this suggests that risk-aversion determines the optimal execution time; this seems to simply substitute one problem for another.

In conclusion, to 'learn' the optimal time seems to depend on the interpretation. If it is option (1) I don't think anything can be learned. If option (2) or (3), the problem becomes instead one of training the parameters of some risk-aversion model (and seeing which risk-aversion results in the largest PnL).

Which of the above interpretations is correct?

If it is an optimal stopping problem, is it even possible to learn/train anything - given the constraints/assumptions above? In this case, how would relaxing these constraints impact the conclusion?

• When you assume the price follows a GBM with zero drift, it means the expected value of wealth falls over time. So an expected P&L optimiser would sell immediately. A mean-variance optimiser would do the same.
– fes
Jun 14 at 15:29
• Note $\mathbb{E}[p(t)]=p(0)\exp(-\sigma^2 t)$
– fes
Jun 14 at 15:46
• If you'd like to use ML to solve this problem, why would you try to infer what the best solution should look like initially? Why not just train your algorithm using lots of past info and let it decide when it is optimal?
– KT8
Jun 14 at 15:46
• Finding an "optimal" solution requires to clearly define what you want to optimise. I do not see this clear definition. You mention maximal P&L and risk aversion but don't state a clear optimisation criterion.
– g g
Jun 17 at 13:53
• Apologies that the question is not clear. I was initially wondering if the secretary problem applied to this scenario, and if so why not? Now I want to extend this more generally. I.e. first I assume/show that one can formulate optimal disposal time problem, as a secretary problem - then I want to know how we extend this model to handle additional assumptions (e.g. if price follows GBM or ABM, market impact exists, trader has risk aversion) - assumptions which also have models. These could then be substituted in the optimal-stopping problem and would, presumably, reduce to optimal execution.
– Zac
Jun 20 at 17:52