Forums  > Basics  > Backtesting option strategies  
     
Page 1 of 1
Display using:  

egert


Total Posts: 53
Joined: Jun 2010
 
Posted: 2011-07-21 12:03
Howdy,

How do you generally backtest options strategies? I think I've fallen into a pit here. I am trying to backtest shorting both call and put spread in DAX weekly options. I have daily OHLC data and historical call/put implied volatility with implied volatility smile (for pricing OTM stuff). Now, the point is that instead of using historical option prices (which tend to be a pitfall on their own as well), I'm pricing options myself. DAX options are regular european type vanillas, so BS does the trick. I think Bloomberg doesn't even let you pull in historical intraday option data? I've only backtested it since beginning of 2010 (80 trades), but the best P&L graphs seem strange (think of Madoff, straight up without any real volatility). And the weekly options on DAX are invention of a later time, no?

I've built a model with two parameters, one is the "risk factor", which basically is the number of strike steps away from ATM and the second is "step factor", which means how many strike steps to you take between the short and long leg of a spread. I'm doing this in Excel at the moment, as I think it can be done there easier than in Matlab. It is shorting spreads (based on BS pricing) in weekly options on monday's open and let's them expire (bear in mind the DAX options expire mid-friday). Transaction cost in terms of commission is barely noticed, so I think the actual execution in terms of slippage couldn't play a huge role as well?

The results indicate that selling spreads far OTM will generally produce a sawtooth type of cumulative P&L graph, where small premiums will be collected and they are offset by losses when I take the punch. Common sense. But, when I short basically ATM spreads (short ATM, buy OTM), the credit collected will greatly offset any losses taken on bigger moves - I think the max loss I saw was less than 75% of spread value (the max risk). Even though the position will expire ITM almost always, it is still profitable (even though goes somewhat against my common sense, which can be wrong).

Now, the results differ greatly with just few parameter steps, I've yet to find P&L surface, but some "generally good results within small parameter range" exists. Could I be totally off here or am I in a right direction??

I can e-mail corresponding excel, but can't upload it (@ work).

Baltazar


Total Posts: 1764
Joined: Jul 2004
 
Posted: 2011-07-21 15:26
One thing to check is the bid-ask spread.
the further from the money you go, the larger the bid-ask spread is going to be.

When you price them yourself, how do you calculate the time value left? for such options, using an integer number of days isn't giving any realistic prices.

In fact did you reconcile your priced option with the market for such options?or you just collect IV and assume the price you calculate is going to match the market? That is the very first step: do you trade realistic prices in your backtest.


Qui fait le malin tombe dans le ravin

egert


Total Posts: 53
Joined: Jun 2010
 
Posted: 2011-07-21 16:46
1) Yes, I will implement spread+slippage into account and get back. Roughly, I think the 10-20% frame seems logical as far as I've observed/checked. Bid-ask is obviously wider for weekly options rather than monthly ones. Of course, I could assume that I will quote myself somewhere between the spread and get filled @ what I think is fair price, but that would probably be short-sighted...

2) Using an integer number of days Sad, how would you advise calculating theta-value?

3) Yes, and they seem pretty much in-line for what the market is pricing them.

This is what my P&L surf per contract (or deal, 4 legs) without spread/slippage looks like:

Baltazar


Total Posts: 1764
Joined: Jul 2004
 
Posted: 2011-07-21 17:10
1/ well you can quote options but you need a fast system to keep up with the underlying moving. Otherwise what you'll get is what people don't want. My (old) experience in dax options was that many strikes where empty most of the time, that can be a problem if you go too far OTM

2/i am not trading these now but I think that half the theta is gone at the opening as you profited from the opening action. bout can tackle that with smaller increment of time or with time varying vol, that's going to be the same. My point is you pay time decay even if you hold position for 1h. model it through theta or through vega with decaying vol, that ends up being paid.

3/is that's indeed the case at several instant in the day. you should have your decay right. Btw way: what do you mean you have historical call put vol: on a minute basis, hour? what OHLC data are you talking about: the dax future or the option prices?

Qui fait le malin tombe dans le ravin

egert


Total Posts: 53
Joined: Jun 2010
 
Posted: 2011-07-23 08:33
Seems that the spread is almost never tougher than 10% now for at least 5 steps OTM. Will get back modelling on monday, when I get to my desk. I have the first profitable trade with this under my belt from this week, so a dumbfound confidence is a bit on the upper side Evil Grin

I have vols on a minute basis and OHLC for dax futures and index, but I am using index as the options will be settled according to that. Could probably get OHLC data for realistic backtesting for options (have to torture someone on the other side of the BB help desk, but prob will pay off). Right now I seem to get stuck on the time decay, so I will try to tackle this.

I've priced 1st/2nd month DAX options myself and so far I've got a pricing error <5% from mid-price. That is testing real-time and fitting the vol-surface. I've taken 3 month paper as RF (will change to 30/60day accordingly), but it shouldn't account for that much anyway. What approximate pricing error should I aim for real-time to assume that my pricing is pretty much correct historically? Of course, as the market never prices the options purely on model-based value, so that means that I can never get to perfections, hence it can get tough...

Considering all previous, I think slippage, which includes bid-ask spread and pricing error, is realistic between 10-20% - need some elaboration on this though...

knocks_rocks


Total Posts: 169
Joined: May 2006
 
Posted: 2011-07-23 18:17
Very interesting results and interesting method of P&L charting, I'm used to seeing multiple equity curves over time when evaluating parameters.

Anyway, if I'm reading this correctly you have (12*7=84) outcomes however only (3*5=15) are profitable; Risk factors 0-4 combined with Step Factors 4-2. I'm eyeballing it and can't see the other side so could easily be wrong here.

So only 18% of your inputs are profitable. It's been sometime since I did nitty gritty back-testing work but if I recall, most of our working strategies had 50%++ of equity curves positive. Now that's not to say it worked real-time, some failed spectacularly lol, just speaking of back-tests.

The Risk Factor (how far short strikes are ATM) seems to make sense. Farther OTM would have higher percentage profit but large negative outliers would negate profits. ATM credit would offset outliers enough to eek out some gains. However the Step Factor (width of spread) is interesting. Very tight spreads or very wide spreads would cause loses. But like Goldilocks, 2,3,4 strike wide is just right. Honestly, not sure what to think of that?

Also I would keep in mind these profits do not include slippage/commission so the percentage profitability may be even less then stated above, I would throw something reasonable in there and see how it effects P&L.

My gut tells me that on a long enough timeline this won't work out. It reminds me of SPX Iron Condors touted by retail traders 05-07ish that ended up losing everything when 08 rolled around.....That being said, it's a limited risk trade, wouldn't hurt putting 1 spread on and comparing results to testing? Maybe accelerated theta decay is the difference?

"...because money won is twice as sweet as money earned."

egert


Total Posts: 53
Joined: Jun 2010
 
Posted: 2011-07-26 14:12
Now back. I used 10% slippage for near the money and 20% slippage for farther from the money options and coming back, only 2 parameter sets remained profitable - risk parameter 0 with steps 3/4.

Now for the first test, I had 66 total outcomes with 11 being profitable, which is still 18%. For the second, it is marginal. Original tests did include commission and the second test included slippage. As near the money slippage has bigger effect, it might make sense to quote that option and do a market order as soon as it gets filled, bud pretty hard to backtest that in excel/matlab, as it would require historical options tick data...

No that I have the model / loop made, I will probably run it on different slow indices to see if the iron condors could make sense somewhere. And adding some complexity might as well help with the P&L, like having some volatility indicator to determine the timeframe (can short longer options), risk and step factors... I have done it discretionaly (and successfully), so I would have to combine.

What I did notice that negative risk parameters (shorting ITM options) combined with step factor >=2 was pretty profitable even with slippage of 20%, so I will dig into this as well...

:P

Strange


Total Posts: 1377
Joined: Jun 2004
 
Posted: 2011-07-26 14:17

In my personal experience, backtesting does not really work on options, the problem has too many dimensions to achieve statistical significance over a relatively short sample period.  You best bet is to do some sort of volatily-driven testing (implied vs realized etc). Anyway, just my 2 c. 

 

PS. egert, sa elad Eestis?


It's buy futures, sell futures, when there is no future!

egert


Total Posts: 53
Joined: Jun 2010
 
Posted: 2011-07-26 14:55
Hah, the last was a loop coding glitch - shorting ITM stuff with ATM/OTM covering doesn't really work Head against Wall

Jah, elan küll - sa oled eestlane? :)
e: ok, already found out that probably not - maybe we can keep in touch / contact?

Strange


Total Posts: 1377
Joined: Jun 2004
 
Posted: 2011-07-26 15:31
Ma ei ole eestlane, ma siiski räägin natuke eesti keelt. Remember very little by now, but my parents are still there. Are you on bloomberg? I'am always happy to talk about vol and ways of looking at it :)

It's buy futures, sell futures, when there is no future!

egert


Total Posts: 53
Joined: Jun 2010
 
Posted: 2011-07-26 15:36
I will drop u an e-mail, if it's ok (in profile?). Yes, I am on BB but I'm rarely logged in (sharing screens/computer atm) these days...

Strange


Total Posts: 1377
Joined: Jun 2004
 
Posted: 2011-07-26 15:42

...


It's buy futures, sell futures, when there is no future!

granchio


Total Posts: 1540
Joined: Apr 2004
 
Posted: 2011-07-26 21:30
as you are talking spreads here, it might make sense to have a trigger on skew?
EDIT the profitable strategy is an ATM fly isn't it... so its smile more than skew. though probably a trigger on price (i.e. probability) is just as robust, maybe more, and more intuitive

"Deserve got nothing to do with it" - Clint

leftic


Total Posts: 86
Joined: Jun 2007
 
Posted: 2011-07-27 21:30
I'm very much with Strange here, backtesting options strategies is a nightmare. And not just because of the raw dimensionality of the problem. You'll run into having to create whole models for some of your parameters: where you'll actually get a fill, the market impact of your trading (much more of an issue with options than equities), hedging strategy and costs, margin/haircut calculations, etc. Some of those problems are arguably harder than the original backtest problem, and possibly more profitable to solve in their own right.

YMMV, of course, but if your backtest assumes worst-cases for these things and your strategy still seems to make lots of money, you're almost definitely messing up somewhere.

HyperVolatility


Total Posts: 130
Joined: Nov 2010
 
Posted: 2011-07-28 00:31

my 1.9999 cents

I prefer doing some kind of implied vs realised type of testing rather than trying to look at what my P/L would be like if I had sold or bought put/call spreads all the way.

Looking at the leverage effect of volatility would also be interesting.

However, I totally agree with Strange


WWW.HYPERVOLATILITY.COM

Baltazar


Total Posts: 1764
Joined: Jul 2004
 
Posted: 2011-07-28 12:03
Working the pnl in terms of vol difference assumes perfect continuous delta hedging.

If you buy at implied vol below realized vol and delta hedge realistically you can still loose money in a significant number of cases.
If you don't plan on delta hedging at all, vols are meaningless and only buying,selling and expiration prices matter.

Qui fait le malin tombe dans le ravin

HyperVolatility


Total Posts: 130
Joined: Nov 2010
 
Posted: 2011-07-28 14:20

@ Baltazar: yes, you are right. I had this issue when I first started backtesting vol trades but now I calculate the final P/L assuming what the final outcome would have been if I had hedged my delta according to a specific strategy (which I am trying to improve).

I have done the sell and walk away and the buy and walk away type of backtests because I replicated some researches done with OTC options data and the results are quite good but the risk is huge compared to the profits I would make.

Thanks for pointing this out and if you have any other suggestions to test options strategies and volatilities I would be very happy to hear them.


WWW.HYPERVOLATILITY.COM

Baltazar


Total Posts: 1764
Joined: Jul 2004
 
Posted: 2011-07-28 15:02
My suggestion would be that if you simulate delta hedging, hedging every fix amount of delta gives better performances (less hedging variance) than hedging every x minutes.
Back testing using the exact same hedging logic you plan on using is even better of course.

This is obvious to anyone who made markets in options but that may not be for people looking at options strategies for the first time.

Qui fait le malin tombe dans le ravin

Keeptrying


Total Posts: 6
Joined: Aug 2011
 
Posted: 2011-08-18 11:54
egert, bumped at your post. It's interesting I was working on something similar. Do you mind exchanging thoughts by email?

egert


Total Posts: 53
Joined: Jun 2010
 
Posted: 2011-08-18 12:08
yes, drop me a e-mail (at profile)

knocks_rocks


Total Posts: 169
Joined: May 2006
 
Posted: 2011-08-31 22:32

If you don't mind me asking, how did your strategy perform during the recent volatility? I'm assuming losses but how did they measure up to previous draw downs?


"...because money won is twice as sweet as money earned."

Jurassic


Total Posts: 61
Joined: Mar 2018
 
Posted: 2018-04-30 23:28
@Strange "You best bet is to do some sort of volatily-driven testing (implied vs realized etc)."

What do you mean exactly by this?
Previous Thread :: Next Thread 
Page 1 of 1