Backtesting Options strategy
-
Hi,
I have been using Backtrader, mostly for Forex trading strategy backtesting, but want to use it for Options strategy backtesting (underlying stock, with various combinations of put/call options, selected based on the underlying stock). I tried QuantConnect but didn't like the fact that everything is remote/cloud-based and local setup was complicated. I know that Backtrader is not designed for this purpose but some of you have already been using it, so would really appreciate some pointers to start off with (things that worked, things to avoid) rather than me trying things from scratch.Thanks in advance,
AP -
if one feeds option prices, then there is no difference. I am using it for live trading with Futures as and 2x put and 2x call.
-
@rajanprabu Thanks! I am assuming you are using the underlying and the related options as separate custom datafeeds, and using signals from the underlying to make trades on the options. The part where I am looking for some guidance -
- If each option (say 5 ITM, 5 OTM for each expiry month) has to be treated as separate datafeeds for backtesting purpose, this could mean you are loading 120 data feeds per backtested year (10 options/expiry month * 12 months), or 600 for 5 years. That's a whole lot to load and process, unless there's a simpler way to feed the data. Not sure if chaining/rollovers would simplify things, but it could complicate the situations as there could be multiple options at same strike price for separate expiry months.
- Can the volatility, greeks be fed as self-defined attributes within custom options datafeeds?
- What will be the best way to tag the options relative to the underlying for selection purpose? In QuantConnect +1, 2, 3 etc let's you select option that are 1, 2, 3 strikes away from current price. Thinking if anything better can be set up here.
Again Thanks in advance!
AP
-
@dehati_paul said in Backtesting Options strategy:
you are using the underlying and the related options as separate custom datafeeds,
Yes, I use Futures data and ATM +/- 2x options feed. But this is for live trading.
@dehati_paul said in Backtesting Options strategy:
If each option (say 5 ITM, 5 OTM for each expiry month) has to be treated as separate datafeeds for backtesting purpose, this could mean you are loading 120 data feeds per backtested year (10 options/expiry month * 12 months), or 600 for 5 years. That's a whole lot to load and process, unless there's a simpler way to feed the data. Not sure if chaining/rollovers would simplify things, but it could complicate the situations as there could be multiple options at same strike price for separate expiry months.
Yes this is tricky.. For options I tested one year at a time. I made a roiling data for options ( its mainly slice and concatenation as I was doing intraday ).
@dehati_paul said in Backtesting Options strategy:
Can the volatility, greeks be fed as self-defined attributes within custom options datafeeds?
I don't use Greeks as mine was pure price actions based on the underlying. But this is certainly possible to extend the feed add them. One can also calculate them in BT.
@dehati_paul said in Backtesting Options strategy:
What will be the best way to tag the options relative to the underlying for selection purpose? In QuantConnect +1, 2, 3 etc let's you select option that are 1, 2, 3 strikes away from current price. Thinking if anything better can be set up here.
Never used quant connect. I simply fed the strike rate as a name/dataname to data feed and used them during backtest.
Maybe other BT users can share better ways of handling it.
-
@rajanprabu Thannks for the comments! Would love to hear thoughts from other BT users.
-
@dehati_paul Have you been able to figure out good solution for above problem statement ? I want to test on options based on signals.