Jurassic


Total Posts: 199 
Joined: Mar 2018 


I was wondering how relative value options strategies are generally backtested? There seems to be many complications that wouldnt occur with linear products.
So if you wanted to do DAX IV vs CAC IV, both ATM say, (like the VIX/V2X spread in vol futures) how would you go about it? I assuming this would come from a delta hedged dac 50d option vs delta hedged cac 50d option?





day1pnl


Total Posts: 53 
Joined: Jun 2017 


Say your package's net present value NPV(spot, rates, vol, time) depends on underlying, rates, vol, and time. Suppose you want to evaluate the trade's profitability by holding it over N days.
1. Estimate the historical joint distribution, P, of daily changes in (spot, rates, vol, time).
2. At time point j (say some specific calendar day) you have a net present value NPV(spot, rates, vol, time) for the package. Draw from P a daily change in (spot, rates, vol, time).
3. Evaluate now your marktomarket P/L by means of your greeks
Spot: delta x chg spot + (1/2) gamma x (chg spot)^2 Rates: rho x chg rates Volatility: vega x chg vol Time: theta x chg time Nonlinear: NPV(spot + chg, rates + chg, vol + chg, time + chg)  (spot PL)  (rates PL)  (vol PL)  (time PL)  NPV(spot, rates, vol, time)
4. Recalculate your new greeks at (spot + chg, rates + chg, vol + chg, time + chg).
5. Redraw from P a daily change in (spot, rates, vol, time).
Repeat (25) N times and sum up the total MTM P/Ls. This gives you one realization of trading the package and holding for N days. If you want to subtract delta risk at some cost according to some specific method, you can just add a subroutine.
The Ntimesteps procedure can then be repeated 999 times or until you reach desired level of confidence.
Not sure this method is too brute force, but at least is a 0th order approximation... 



day1pnl


Total Posts: 53 
Joined: Jun 2017 


Ok that was the pretty noobish part.
I guess the tricky part is to point towards some workaround that makes sure that the vols slide down correctly in your estimated distribution of daily changes (when the old 4 motnh contracts roll into the new active contract).
I suppose that the "new volatility" postroll should be the volatility corresponding to a strike having the same daily B/E as the old contracts had prior to the roll date. But correct me if wrong 




Jurassic


Total Posts: 199 
Joined: Mar 2018 


@day1pnl. That just seems too complicated, I keep thinking there must be something easier.
The problem is that the strike that the option had will change with time. In research you probably want to use IV with sticky delta, but you cannot execute in this space. If you use IV by sticky strike I cannot see how your research is relevant in the future. For instance risk reversals would be particularly problematic.
Is this problem easier with gamma or vega strategies?




frolloos


Total Posts: 66 
Joined: Dec 2007 


Can you mark the positions to model or do you have to mark it market?
Reason I ask this is that if you can mark the positions to model you can delta hedge the options *to maturity* at the *constant* implied volatility you initially purchased the options for, i.e. you don't update the implied vol when revaluing the positions and your delta hedge will be based off the initial implied vols.
The final p/l of this strategy is then purely the daily (initial) implied variance  realized variance of both options weighted by their respective gammas.
If you do have to mark to market then you'll need to use the running implied volatility of both options and that will be more messy. 




Jurassic


Total Posts: 199 
Joined: Mar 2018 


Im not sure why market to model or mark to market would be more difficult to the other?
To be honest Im really confused now as to how options strategies are backtested 



frolloos


Total Posts: 66 
Joined: Dec 2007 


forgetting the mark to model or mark to market for now, I take it you understand that delta hedging the options till maturity using the initial implied volatility gives you gamma p/l?
there are numerous option strategies. I am assuming you dont mean the more static strats such as call overwriting etc. 




ronin


Total Posts: 435 
Joined: May 2006 


> The problem is that the strike that the option had will change with time. In research you probably want to use IV with sticky delta, but you cannot execute in this space. If you use IV by sticky strike I cannot see how your research is relevant in the future. For instance risk reversals would be particularly problematic.
@Jurassic, I think you have gone off on a tangent a bit here.
You would backtest like you would backtest anything else. If your strategy wants to buy an option, make it buy an option. If it wants to sell it, make it sell it. If you have actual option prices it is easier, if all you have is IV surfaces you have to construct the option synthetically. And then track your inventory of options bought and sold so you can mark them to market.
> The problem is that the strike that the option had will change with time
No it won't. The strike won't change with time, weather, or a globar thermonuclear war. Strike is strike.
> In research you probably want to use IV with sticky delta, but you cannot execute in this space.
Sticky delta is your assumption about how the vol surface will change in the future. It has precisely nothing to do with backtesting. You backtest with the vol surface as it actually was on any given day, not as you thought it might be at some previous time.
> So if you wanted to do DAX IV vs CAC IV, both ATM say, (like the VIX/V2X spread in vol futures) how would you go about it?
On day 1, you would say get me long 27 puts on DAX, strike 12,250, maturity 21st Sep 18 at 336.10, and short 54 puts on the CAC, strike 5,520, maturity 21st Sep 2018 at 121.10.
You would book 2,535.30 in cash plus the two option positions.
Every day from now until 21st Sep 2018, you would execute any delta hedges, and you would mark cash, your outstanding option positions and your outstanding delta hedges at mid, and you would book it all as your daily pnl.
On 22nd Sep 2018, your option positions would be settled and you could stop marking them.
It is more complicated than cash instruments because you have multiple positions to track, but that is how option trading works. If you think backtesting options is hard, wait till you start trading them...

"There is a SIX am?"  Arthur 


Jurassic


Total Posts: 199 
Joined: Mar 2018 


Ok had a think about this.
The problem with backtesting using prices, that I can see, is that for a given price there can be two implied vol, which is what options are usually quoted in. This should cause problems as it will be hard to say these options would evolve into the future in the same way 




ronin


Total Posts: 435 
Joined: May 2006 


@Jurassic,
Stop making stuff up. Try doing it instead.
Start simple. Open an excel spreadsheet. Assume Black Scholes, single vol that does not change with time, strike or maturity. Download the history for the underlying from Yahoo finance. Buy or sell an option on day 1, and buy or sell some delta to make it flat. Then evolve it every day to maturity, and at every day reprice the option, calculate the delta, and adjust the delta hedge to keep delta within some limits. You should be tracking the size of the option position, size of the delta hedge, and the amount of cash.
A long, long time ago, when I was a junior quant, that was an actual exercise they made me do on my second day.
Once you have done that, you can try some real options. They are also on Yahoo finance. Btw, they are not quoted in implied vol.
This is from Yahoo finance this morning, some puts on AAPL.
PutsforSeptember 21, 2018 Contract Name Last Trade Date Strike Last Price Bid Ask Change % Change Volume Open Interest Implied Volatility AAPL180921P00075000 20180502 11:20AM EDT 75.00 0.01 0.00 0.00 0.00  4 0 25.00% AAPL180921P00080000 20180423 10:54AM EDT 80.00 0.06 0.02 0.11 0.00  20 346 50.00% AAPL180921P00085000 20180307 2:27PM EDT 85.00 0.08 0.06 0.14 0.07 46.67% 1 555 50.88% AAPL180921P00090000 20180423 9:41AM EDT 90.00 0.09 0.04 0.15 0.00  15 689 47.66% AAPL180921P00095000 20180312 9:34AM EDT 95.00 0.05 0.07 0.18 0.00  10 3,749 45.31% AAPL180921P00100000 20180502 12:43PM EDT 100.00 0.07 0.05 0.11 0.14 66.67% 61 1,679 39.26% AAPL180921P00105000 20180424 12:46PM EDT 105.00 0.29 0.22 0.36 0.00  25 859 42.94%
Take it from there. At one point, you'll probably move from Excel to something else. Good luck. 
"There is a SIX am?"  Arthur 


Jurassic


Total Posts: 199 
Joined: Mar 2018 


Ok I have done that in Excel.
I think Im still struggling to understand what options strategies aim to predict. With equities its whether the stock goes up or down. With options every option at a different strike for a given vol is different. 




frolloos


Total Posts: 66 
Joined: Dec 2007 


Deltahedged option strategies do not necessarily aim to predict, but they aim to monetize a view / expectation of how the volatility of the underlying will behave in the future.
An unhedged option strategy, i.e. buying a call spread and holding it until maturity, aims to monetize the view that the underlying will move up but not beyond a certain level.
Have you followed ronin's suggestion? I suspect, but correct me if I'm wrong, that you might need to understand fully the mechanics of delta hedging just 1 option first, before you start adding more options and getting totally lost in the maze.




ronin


Total Posts: 435 
Joined: May 2006 


> I think Im still struggling to understand what options strategies aim to predict.
Good going.
Are you making money or losing money with that?
Start changing the (flat, constant) implied vol of the option. Where is the breakeven? At what implied vols do you make money, and at what implied vols do you lose money? How does that compare to the realised vol of the underlying? What happens when you consistently overhedge by some factor, and what happens when you consistently underhedge?
Once you know that, you have the basic element of trading gamma and vega.
The next step would be to separate gamma from vega.
Make your original option longer dated (1y plus, so it has some vega), and start hedging the gamma. That is, take a short dated option (say 1m or so, so it has no vega and lots of gamma) and use it to flatten the gamma of your long dated option. Delta hedge the net option position. When the short dated option expires, roll it to next month.
Again, you want to understand how this makes money and how it loses money.
Now you can start changing the implied vol of the short dated options vs the implied vol of the long dated option (introduce some term structure) and see what that does.
Then you can start playing with smile and skew. Take two options with different strikes and different implied vols, see how your pnl does for either of them.
That, in a nutshell, would be what vanilla options are for  gamma and vega. Forget delta. You want delta, trade the underlying.
Once you get there, you can start looking at a vol surface. Which options are mispriced in absolute terms (so they are worth running naked), and which options are mispriced in relative terms (so it makes sense to put up a spread)? The only way you can understand that is if you know how to make money from gamma and vega, hence your excel exercise.

"There is a SIX am?"  Arthur 



Jurassic


Total Posts: 199 
Joined: Mar 2018 


Worryingly, in my excel spreadsheet, realised vol = implied vol does not breakeven (for the flat vol, delta hedging case).... 



day1pnl


Total Posts: 53 
Joined: Jun 2017 


Did you simulate geometric brownian underlying? Think a sample of real data would almost always have a breakeven vol for each strike K (i.e. a breakeven skew). 




Jurassic


Total Posts: 199 
Joined: Mar 2018 


No I took AAPL from last month (a couple of days ago). Took the option ATM at 168
Ok this delta problem is fixed now and the breakeven is implied vol = realised vol 



Strange


Total Posts: 1532 
Joined: Jun 2004 


> Sticky delta is your assumption about how the vol surface will change in the future. It has precisely nothing to do with backtesting. You backtest with the vol surface as it actually was on any given day, not as you thought it might be at some previous time
That’s not really true, right? Your assumptions about the nature of volatility and of vol surface dynamics are gonna influence your delta hedging. Imagine that you are back testing a long dated skew strategy  your assumptions about the relationship of vol and spot are going to be the key aspect of the strategy and will be reflected in your delta.
Ps. Actually, upon reading the rest of the thread, I think worries about the quality of delta is far away 
I don't interest myself in 'why?'. I think more often in terms of 'when?'...sometimes 'where?'. And always how much?' 



Jurassic


Total Posts: 199 
Joined: Mar 2018 


I get that from a delta hedged option, the gamma pnl is IVRV and the vega pnl comes from the IV. (Not sure how this is derived though).
But I still dont see how you backtest these...
Lets say you have a short term option ~30days (lots of gamma, little vega) would you look to predict the option implied vol  realised vol spread? 



day1pnl


Total Posts: 53 
Joined: Jun 2017 


would look to predict quadratic variation of underlying
Gamma pnl comes from gamma. Vega pnl comes from vega. your vega risk can be calculated by brute force, e.g. by "bumping" the implied vol 1 pts in your model and recalculating the allupfront value for the derivative
EDIT: but since your delta hedged pnl is going to be path dependent would look into that too  doesn't matter if you get the quadratic variation you asked for if it happens in a range outside of where your derivs have gamma, and vice versa you can get smoked selling if all the variation happens where you have the most negative gamma but in any other range stays still 




ronin


Total Posts: 435 
Joined: May 2006 


@Jurassic,
Gamma and vega are not the same thing. They are not even similar.
For a short dated option, all you care about is whether it ends up ITM or OTM. If it's ITM now, that makes your delta look one way, and if it's OTM now that makes it look the other way. That's gamma. Gamma makes you trade the underlying to delta hedge. You make gamma if you buy low, sell high. You pay gamma if you buy high, sell low.
For a long dated option, you can drift ITM/OTM all the time, and you don't care. There is plenty of time in which that can revert. All you care about is how the implied vol moves around. That's vega. If you sold an option at high vol and you can buy it back at lower vol, you made money. Even if you are buying it back at higher vol you might be in the black, because you made some theta.
Then there are ultra long dated options, which is what @strange was alluding to. Vega is discounted away and things start being driven by volatility of discount factors and forward factors.
At some point, it might make sense to look at Haug's "know your weapon" articles. I'm not recommending them for serious use, but they do talk about basic exposures in a reasonable amount of detail. There is also an article somewhere that talks about hedging with wrong vol, and what that does to the hedging pnl  I don't remember who the article was by, but google it.

"There is a SIX am?"  Arthur 


Jurassic


Total Posts: 199 
Joined: Mar 2018 


@ronin
I realise gamma and vega are very different. Just had a look at Haug's, looks fantastic.
Im still struggling to understand where this is going. If you wanted to backtest a strategy for AAPL, you would say something like if this happens, then AAPL down,... But with options if you buy them at different strikes with different vols,different deltas... you have execution in (related) but slightly different products.





ronin


Total Posts: 435 
Joined: May 2006 


@Jurassic,
You are right, every option is different. And every option decays to zero optionality within a fixed term.
That doesn't mean you can't trade them profitably and consistently. You just have to get used to how you make money in options.
Historically, 101 of option trading was running short gamma.
The idea behind short gamma is that you are paid (the option premium) every day, but you lose money on occasional big moves.
If you diversify your basket (i.e. you run short gamma on 100+ symbols), you are still getting paid the premium for every symbol, but now you have diversified away your exposure to big moves. You are still exposed to systematic moves though.
The next step would be to say run short gamma for each symbol, but buy back the gamma of the index. The overall correlation in the index is less than 100%, so the index option is cheaper than the single stock options. So now you are making a bit less, but you are less exposed to systematic moves.
Etc. Hopefully this is enough to get you started.

"There is a SIX am?"  Arthur 


Strange


Total Posts: 1532 
Joined: Jun 2004 


On a more advanced note, building a back testing setup for trading volatility that is efficient, flexible and easy to use is not straightforward. I found that it’s easy to get any 2 out of these three things, but still struggling with some bits. 
I don't interest myself in 'why?'. I think more often in terms of 'when?'...sometimes 'where?'. And always how much?' 



Jurassic


Total Posts: 199 
Joined: Mar 2018 


@ronin
Yeah I get all of that. Isnt short gamma just one options strategy though? 



ronin


Total Posts: 435 
Joined: May 2006 


> On a more advanced note, building a back testing setup for trading volatility that is efficient, flexible and easy to use is not straightforward. I found that it’s easy to get any 2 out of these three things, but still struggling with some bits.
@strange,
You can actually get 2 out of 3? Respect. 1 out of 3 is hard enough....
> Isnt short gamma just one options strategy though?
@jurassic,
You got two here  short gamma and index dispersion. How many more do you want? It's up to you to come up with your own strategies.
Actually you got 3  directional vega as well. Seriously.

"There is a SIX am?"  Arthur 


