返回题库

德尔斐神谕:带交易成本的最优交易

德尔斐的神谕

专题
Finance / 金融
难度
L4

题目详情

The Oracle at Delphi On January Ist you go to the Oracle at Delphi who tells you the opening and closing prices of a smallnon- dividend- paying stock every trading day for the rest of the year. Every opening price is the same as the closing price the day before. You have a 0.5%0.5\% one- way transaction cost in buying or selling the stock, and can buy every day at the opening price and sell every day at the closing price... if you choose. On the last day of the year you must not own the stock. What is the best you can do, having this perfect foresight? Every day you can buy stock at the opening price if you don't own it, and sell stock at the closing price if you do own it. Keep the problem simple, no leveraging, no short selling, no options or futures, etc.

解析

已知全年每个交易日的开盘/收盘价(开盘价等于前一日收盘价),单边交易成本 k=0.5%k=0.5\%

这是典型动态规划:定义

  • LiL_i:第 ii 天收盘后“持仓(持有 1 股)”时可达到的最大财富
  • NiN_i:第 ii 天收盘后“空仓”时可达到的最大财富

设第 ii 天日收益为 RiR_i(开到收的相对收益)。则递推为

Li=max((1+Ri)Li1, (1k)(1+Ri)Ni1),L_i=\max\Bigl((1+R_i)L_{i-1},\ (1-k)(1+R_i)N_{i-1}\Bigr),

(要么继续持有,要么从空仓买入并承担交易成本)

Ni=max(Ni1, (1k)Li1)N_i=\max\Bigl(N_{i-1},\ (1-k)L_{i-1}\Bigr)

(要么继续空仓,要么卖出并承担交易成本)。

初值 L0=0, N0=1L_0=0,\ N_0=1(初始财富 1 且空仓)。最终最大财富为

max(NM,(1k)LM)\boxed{\max\bigl(N_M,(1-k)L_M\bigr)}

其中 MM 为交易日数。