Tracking error Black Scholes

Suppose an asset follows the SDE

$$d S_{t}^{1} = \mu S_{t}^{1} dt + \sigma_{t} S_{t}^{1} d W_{t}$$ Furthermore assume that $r = 0$ and a trader who uses Black-Scholes for pricing and hedging with volatility $\sigma^*$ for a terminal value claim with payoff $h(S_T)$. Then the price of the claim under BS is given as the solution of the PDE

$$h_t^BS(t,S) + \frac{1}{2} (\sigma^*)^2 S^2 h_{SS}^{BS}(t,S_t^1) = 0$$

with $h_t^BS(t,S) = h(S)$.
The tracking error of his hedge is then given by

$$e_T = h(S_t) - V_T$$

It can be shown that in this case it is equal to

$$e_T = \frac{1}{2} \int_0^T ( S_{t}^{1})^2 (\sigma_t^2 - \sigma^*) h_{SS}^{BS}(t,S_t^1) dt$$

Now suppose that the trader sells a plain vanilla call option and replicates this option with a stock postion equal to the delta of the call. Hence, at this time point $t$ he is delta neutral.

Now suppose the true volatility $\sigma_t^2$ is bigger than the volatility $\sigma^*$ he used for replication. According to the formula $(\sigma_t^2 - \sigma^*) > 0$ and the gamma of the position is $$h_{SS}^{BS}(t,S_t^1) > 0$$ Hence, $$e_T > 0$$ and the trader makes a loss.

From an intuitive stand point this is clear for me - the trader is short a call option which has a convex payoff - for a large move of $S_t$ the option will gain more value than this hedging portfolio and since he is short the option he will have a loss. However, it is not clear for me why $$h_{SS}^{BS}(t,S_t^1) > 0$$ - the call option has a positive gamma since again it has a convex payoff but he is $\textbf{short}$ the option hence the gamma would be negative as far as I see.

Ok after going trough it again $h_{SS}^{BS}(t,S_{t}^{1})$ represents here the Gamma of the option independent of the position the trader took in it. Since the payoff is convex gamma is positiv.

Quick example to cross check it:

Intuitive approach:When a trader buys a call and hedges it he would profit from a higher volatility then he used for pricing.

Approach with the formula: Would he have bought one call and replicated it then he would have a profit if $e_T > 0$ since it would imply $h(S_T) > V(T)$. This mean for $\sigma_t^2 > \sigma^*$ the formula of the tracking error again yields a positive outcome since also $h_{SS}^{BS}(t,S_{t}^{1}) > 0$.

In the tracking error formula, it is not the second derivative of Black-Scholes that you should consider but the gamma of the portfolio: the sum of (positive) gammas of the options weighted by your (positive or negative) positions. If you are short an option, your gamma is negative and the tracking error is negative (loss) when volatility realizes higher than implied. BTW this formula was called Robustness of Black-Scholes by El Karoui (1998) and Fundamental Theorem of Derivatives Trading by Poulsen (2015). Dupire exploited it in the mid 1990s to find many interesting results, as I summarized in a tribute for his 60th birthday in Rio last month. The video is found on YouTube, here: https://www.youtube.com/watch?v=-YiAMxjOKHg

If the trader is short the call then the pnl of her delta hedged portfolio is made of the theta rent which is positive and accrues at the implied volatility $$\sigma^*$$ times dollar gamma and and the short gamma pnl which is also proportional to the dollar gamma and the realized volatility $$\sigma$$.

Now whether the trader makes or loses money is not just a function of whether on average $$\sigma > \sigma^*$$ but also the path followed by the gamma.