Profile Picture

How to Backtest Options Strategies

Posted By dspicer527 9 Years Ago
Message
Posted Sunday January 27 2008
I am interested in backtesting a trading system.  I want to start with a real simple set of entries and exits, say just on stocks to keep it very simple--no commodities or forex just yet.  The problem is, I don't buy stocks, I buy call spreads to get long, and put spreads to get short.  If I used Tradestation/Metastock/etc. to test a system that bought and sold STOCKS based on simple entry and exit rules, that'd be pretty straightforward.  My question is, what trade simulator software would be best for testing those same rules but buying spreads instead of the stocks themselves?  I'm sure lots of folks here use bull call spreads and bear put spreads, does anybody have a tested system that uses these  options strategies with simple entry and exit rules?
phg
Supreme Being (44,815 reputation)Supreme Being (44,815 reputation)Supreme Being (44,815 reputation)Supreme Being (44,815 reputation)Supreme Being (44,815 reputation)Supreme Being (44,815 reputation)Supreme Being (44,815 reputation)Supreme Being (44,815 reputation)Supreme Being (44,815 reputation)
Posted Sunday January 27 2008

Well, to start with, you are right there are others on this list with an abiding interest in options, including some at RE. While RE (C#) is probably as good a base as any for tackling options trading, the daunting prospect is the infrastructure that would need to be created to deal with the variety of strikes and combinations. Not to mention the potentially immense amount of storage needed to hold historical options quotes for backtesting. I'm not even sure where historical options data can be obtained?

There have been a few inconclusive posts on this forum and the Yahoo group about how real time quotes might be brought into play.

So, while what you want to do is not available 'out of the box', there is a contigent here who would be interested in hearing more details, and perhaps help develop a list of tools that would be needed to enable what you want. For example, RE does not currently have an interface for specifying dynamically strikes of interest. However, there is a C# socket client that can be used in conjunction with RE that would allow that information to be obtained from IB, asynchronously. That's one piece to the puzzle. What other services are needed?



-Pete

See also Yahoo group about applying RE.

Posted Monday January 28 2008
I think Pete brings up a point in huge volumes of option quote data.  I've dabbled with options backtesting, but the problem is getting historical data.  I would think you'd need almost all strikes.  In my personal situation, I may use technical and fundamentals to determine my direction, but then before I picked my strategy, I'd need to analyze the various strikes to analyze implied volatility or other greeks and how they relate between various strikes.  Assuming you can get the data, none of this is impossible and then finally executing the trade is probably the easiest part of all.

Another point to consider, no strategy is inherently superior in options assuming everything is lognormal distribution.  So in my opinion, exploiting [what you believe are] price discrepancies, whether in the underlying or through mispriced options is the edge.

phg
Supreme Being (44,815 reputation)Supreme Being (44,815 reputation)Supreme Being (44,815 reputation)Supreme Being (44,815 reputation)Supreme Being (44,815 reputation)Supreme Being (44,815 reputation)Supreme Being (44,815 reputation)Supreme Being (44,815 reputation)Supreme Being (44,815 reputation)
Posted Monday January 28 2008
Bill, can one currently buy and sell options through RE? That is, does the PositionOrder object have elements for specifying option details such as expiry, strike, multiplier, etc? Can bid and ask be accessed in a stategy? (I can foresee a case were you trade an option real time although you have no historical data for it -- just like is done using TWS manually.)

-Pete

See also Yahoo group about applying RE.

Posted Monday January 28 2008
Yes.  The contract information is specified with the symbol properties (right click on a symbol, select Props).  So if you were watching XLF, and had your eye on the front month 28, 29, and 30 calls and the 25, 26, and 27 puts, you'd have to set up 6 symbols.  Double that count if you wanted to watch both front month and front month + 1.

This is a bit cumbersome to setup and maintain, but it kind of has to be this way for one big reason.  What if you were getting option data from OpenTick and then submitting an order through IB.  We need to have a way to abstract contract details between the two providers.  Everyone seems to specify contracts a bit differently, so this is why we've set it up this way.  When we add automation features to the watchlist, this task could certainly be automated.

phg (1/28/2008)
Bill, can one currently buy and sell options through RE? That is, does the PositionOrder object have elements for specifying option details such as expiry, strike, multiplier, etc? Can bid and ask be accessed in a stategy? (I can foresee a case were you trade an option real time although you have no historical data for it -- just like is done using TWS manually.)
Posted Thursday January 31 2008
Quick follow up here because I know options contain a lot of parameters (strike, exp. month, put/call, etc).  I wanted to show a screen shot of an options contract in the symbol setup.  I'm using the XLF FEB08 27.00 call.

For the sake of simplicity, I left tick size and contract size blank.  But options are a leveraged vehicle, so for backtesting you'd want to populate these.  For equities, it's likely going to be 0.01 for the tick size and 100 for the contract size.

Also note, I'm using the root symbol (XLF) as the symbol.  I'm not putting any additional contract identifiers at the end of the symbol.  RightEdge will negotiate this with the data provider.

Posted Wednesday January 02 2013
dspicer527 (1/27/2008)
what trade simulator software would be best for testing those same rules but buying spreads instead of the stocks themselves? I'm sure lots of folks here use bull call spreads and bear put spreads, does anybody have a tested system that uses these options strategies with simple entry and exit rules?


Dspicer527, I know this post is quite old but i was looking for exactly the same software and i have found oscreener.com. It allows to backtest bull put spreads and bear put spreads. Bear in mind Bull put spread is a credit spread and Bear put spread is a debit spread. Although I have also noticed put spreads are better priced comparing to call spreads. I prefer bull put spreads and long put options. Wink





Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems