Modeling Option Trading

Overview

In this section on modeling, I’ll explain the main features of the model at a relatively high level.  I’ll avoid math and equations and detail, but they are available (with the exception of the BuySell function and the Main routine) with the Premium membership.  There are seven key components:  

calculating the return from selling options – each stock, each day, puts and calls

– ranking the best opportunities each trading day, based on the foregoing return calculations, so the best opportunities have first dibs on cash

– triggering the sale of an option if sell conditions are met

– optimally allocating available cash to these sale opportunities, within allocation limits

– opportunistically buying back an option

– handling the expiration of the option if not bought back opportunistically, and

– determining optimal trade governing parameters.    

The model needs to handle market considerations – determining how much premium (and therefore prospective return) will be provided by a particular combination of market conditions and option characteristics, and when to sell and when to buyback the option.  And it needs to handle accounting considerations – how much cash is available and should be deployed to a particular sale opportunity, how many contracts were sold and at what strike/term to expiration, how many dollars were secured, how much cash is freed up from a buy back or an expiration that needs to go back into the pool for redeployment, and how much realized gain was earned.  The accounting considerations are relatively straightforward; they are the science in this exercise.   You have to be accurate, but it’s simple math. The market considerations are where the art (and the real value added on my part) is: what technical indicator or combination of indicators should be used to trigger the sale of an option, at what level(s) should it trigger a sale, with what measure and at what level should we buy it back vs. letting it expire?  Here the model is mostly empirical, based on my learnings from what works when I trade – though it’s important to point out that the model has begun to inform my trading as I’ve optimized the various parameters.  Trading 40 stocks over 16.5 years is a robust teacher.   

xxx

Calculating Prospective Return

Each day the call price and put price is calculated for each stock, based on a particular time-to-expiration and degree-of-moneyness, the dividend yield of the stock, and based on prevailing market conditions of interest rate and volatility.   The model currently calculates a daily historical volatility over a 40 day period, which is then annualized, as a proxy for implied volatility.   A review of many stocks in my stable indicated that implied and historical volatility tend to dance together, implied sometimes being higher than historical, then switching.   This was not a formal study, just a review.  I’ve seen references suggesting that implied volatility tends to be higher than historical, but I have not been able to find a serious academic study of the U.S. options market regarding this point.   Nonetheless, I felt that historical would be a reasonable proxy for implied, adequate for present purposes.  Once I migrate the model to providing trade alerts, I’ll need to source option prices and use these instead. 

A standard Black-Scholes-Merton model for European options on dividend paying stocks is used to determine the per share call and put price.   Stock options are all American style (meaning they can be exercised anytime), so a European (exercise only at expiration) option pricing model will tend to understate the price of the option – thus introducing some conservatism to the model.   I’m guessing that since the market tends to not actually exercise options until very close to the expiration date, the market probably doesn’t price in much value for the American feature.   I didn’t think the hassle of a binomial tree, which is typically used to price American options, was worth the increased accuracy to capture the value of the American feature.

For a put, the prospective period return is calculated as the put price divided by the strike price.  For a call, the prospective period return is calculated as the call price divided by the stock purchase price (since purchase price sets the dollar amount that is “secured”).  We could multiply all prices by 100, since one option contract is 100 shares, but this is not necessary to calculate return.  [To calculate the premium received, multiply the option price by 100 and by the number of contracts sold).  Finally, I annualize the period return by dividing it by the term-to-expiration (expressed as number of months) and multiplying by 12.   You want everything on an annualized basis, so that the results from different times-to-expiration can be meaningfully compared – both during trading and in the model.  Thus, in summary, for each stock each day, the model calculates two annualized returns – one for a put and one for a call.   

xxx

Ranking Opportunities

The model rank orders each stock’s put and call by calculated return and then sends these to the sale triggering part of the model in order of highest return.  There’s a little more going on than what I describe here, but this is the essence of it.  What we want is for the highest annualized return opportunities to have the first dibs on available cash.

xxx

Triggering an Option Sale

For puts, a sale is triggered by the combination of a specified percentage drop in price over a specified amount of time (the look back period) and the MACD bottoming.  For calls, a sale is triggered by the combination of a specified percentage increase in price over a specified amount of time and the MACD topping.  The thought was that it isn’t enough that there be a sufficiently large change in price, the MACD also has to indicate that the price trend is turning.   And that it isn’t enough that a price trend is turning, it has to have changed by a ‘meaningful’ amount over a particular period of time – to give the spring back some force. This is referred to as an AND condition: both parts of the condition have to be true for the option sale to be triggered.  The length of the lookback period used to calculate the percent price change is left for the model to determine, such that the ending  portfolio value is maximized.  Similarly, the amount of the percentage change in price required to trigger an option sale is also left for the model to determine, such that ending portfolio value is maximized.   As I’ll discuss below, the model tests many combinations of these parameters over a range of reasonable possibilities.

MACD has three parameters: a short EMA (exponential moving average) period, a long EMA period, and a signal period.  The MACD line is the difference between the short and long EMA.  The signal line is a simple moving average (SMA) of the MACD line.   For a daily MACD, the periods used to calculate the EMAs are traditionally set at 12, 26, and 9 days, respectively.  As was the case with the determination of the percentage price change and lookback period, I let the model determine which levels of the moving average parameters maximize the ending portfolio value.   Put and call parameters are optimized separately. 

xxx

Allocating Available Cash

There are two considerations involved in allocating cash.  Recall from my comments earlier that the highest return opportunities see the available cash first.  On any given day, available cash can range from 0% to 100% of the then portfolio value.  The goal of the allocation process is to give the most money to the highest return opportunities, subject to an overall cap on the allocation to a given stock. 

To accomplish this goal, the model allocates available cash on a linear schedule, between 15% and 30% annualized return.  Think of this as a preliminary allocation.  Below 15% annualized return, only a de minimus amount is allocated; it turns out to be easier (from a coding perspective) to allocate a de minimus amount than it is to allocate zero.   Starting at 15% annualized return, available cash is allocated as a function of prospective return; above 30% annualized return, the allocation flatlines at 99% of available cash.   I selected 30% annualized return as a ceiling, since the market usually doesn’t provide much more than this; I also wanted to mitigate the impact of any potential ‘money machines’ having been created due to using historical volatility rather than implied.  15% to 30% annualized return covers the range of practical trading interest.  The preliminary allocation amounts so determined are then capped such that no more than 5% of portfolio market value can be allocated to a single stock/option.  While a call and a put won’t be initiated on the same stock on the same day, given changing market conditions over a 1.5 to 2 month time-to-expiration, it is possible for a stock to have both a put and a call at the same time.  Therefore, it is possible to have a 10% allocation to the same stock, market risk of the options balanced to some extent by the put and a call offsetting one another.  Since the stable contains only solid stocks, I’m not too worried about credit risk over the short time increments involved. 

xxx

Triggering a Buyback

For both puts and calls, there may come a time when it is smart (i.e., optimal) to buy the option back so that the cash released can be re-deployed.  The model will buy back a put at an optimal return that it determines in combination with all the other governing parameters.   This return is calculated as buyback option cost divided by original premium at the sale.   In the case of calls, as I’ve mentioned previously, providing the model the freedom to buy back the call only is not optimal.   [I’ve retained the code, to try this approach again once option prices are in the model].  So only pair buyback is allowed: that is, the call option is bought back at a loss and the underlying is sold at a (larger) gain, for a net gain on the closeout.    This return is calculated as net gain divided by purchase cost of the stock.

xxx

Handling Expiration

At expiration, the option is either out-of-the-money or in-the-money.   For an in-the-money put assigned to me, resulting in a stock purchase at the strike price, the model will sell that stock immediately so that the cash can be re-deployed.  Similarly, for an out-of-the money call, resulting in me retaining the underlying, the model will sell that stock immediately so the cash can be re-deployed.  I call this situation immediate economic reconciliation.  In my actual trading, I’m endeavoring to migrate to the more ruthless immediate economic reconciliation that the model clearly prefers.

An alternative approach would retain the stock in these situations, waiting for improved market conditions to sell the stock or lay on a call.  I refer to this situation as delayed economic reconciliation.  I have coded up this relatively more complicated situation, since it is a trading approach I use.  In all the tests I’ve run, it results in sub-optimal returns, not close to those achieved with immediate economic reconciliation.  I’ve retained the code to try delayed economic reconciliation again once I have real option prices flowing through the model. 

xxx

Model Parameter Optimization

Last, but not least, the model provides a way to evaluate what parameter values are optimal.  It does this by doing many iterations, methodically varying individual parameters over a predetermined range at predetermined intervals.    In the current version of the model, the following parameters are in the master iteration loops (within which the entire program nests):

Lookback period (to calculate percentage price drop / price increase)

Percentage Price Drop / Price Increase (to act as a dual trigger, with MACD, to sell an option)

MACD slow EMA period

MACD fast EMA period

MACD signal period

Put and call pair buyback return hurdles

Degree of moneyness

Term to expiration

Preliminary cash allocation and the maximum allocation cap can be varied, but only manually, not as part of the optimization process.

xxx

Model Output

Here’s an Excel chart showing the model’s option trading results vs. a buy-hold strategy, over the 16.5 year backtest period, using the optimal trading parameters. The model generates an average annual return of 21.5% vs. 17.8% for the buy-hold strategy, an outperformance of 370 bps outperformance with half the drawdown risk. It’s a beautiful thing. All the details are found in the Parameter Optimization section.

xxx

xxPx

The Path Ahead

Lastly, a few words about future improvements.  Here’s my current list, it’s all exciting work.   A big explore.

– evaluate a buy back return hurdle schedule: the sooner the buyback, the lower the return hurdle (working on this currently)

– import option prices into the model, and use these rather than calculated prices for all trade decisions; reoptimize the governing parameters

– develop a stepwise learning capability and/or recognize trading regimes and adjust optimal parameters accordingly

– evaluate using MACD to trigger buyback, either with or without a buyback return hurdle

– evaluate the role that implied vol or vol percentile might play in enhancing the trade decisions

– further evaluate other call sell triggers to reduce incidence / effect of OTM expiration and dead money

– further evaluate delayed economic reconciliation

– further evaluate opportunistic call only buy back

– explore a wider range of parameter settings

– implement and test other technical indicators

– evaluate other underlyings for inclusion in stable

– adapt the program to facilitate parallel processing, thus speeding up run time and allowing for more thorough optimization.

xxx

Epilogue

Seems like I’m always learning something about the market; it’s a great teacher with sometimes painful lessons.

1.  Stay organized.  This is especially important for options, which add a layer of complexity to the investing process.   When the markets are moving fast, you don’t want to fumble around to make a decision.  You’ll want to easily and quickly be able to calculate the prospective annualized return for a given strike/time-to-expiration.  You’ll want to quickly know your current exposure to each stock, and therefore how much more capacity you have in that name.   I impose a 5% allocation limit on how much of a given company I’ll own.  This simple rule keeps me from getting overly greedy when I think it’s a great deal. 

2.   Your focus is on individual stocks, and what their MACD and option situation is telling you about their attractiveness.   All the media hype is on the SPY, but what’s going on in the SPY is actually less relevant than what’s going on with QQQ or VTV (Vanguard Value ETF).   Just by watching your 40 individual stocks, you actually have a pretty good sense of what the overall market and market segments are doing.  And individual stocks can and do swim against the current.  

3.  I have a bias to be fully invested (i.e., sold calls on entire portfolio and/or sold puts using up most all the cash), since that’s how I make money.  There is much to be said, though, for generally maintaining some dry powder, but when a 30% or more prospective annualized return opportunity comes along – that dry powder gets used.  Opportunities pop up all the time amongst my list of 40 companies.    

4.  Lastly, here’s how to compete with and even beat the hedge funds and their algorithms – fight your fight (an old boxing adage).  Find a way to get an edge (we have three with the approach described herein) and be disciplined.  You can’t compete with them on their terms, you don’t have the resources – the analytics, phDs, the supercomputers.  But you can still take advantage of them.  One of the reasons, probably the main reason, that stock prices gyrate so much is because of the lemming like behavior of the hedge funds. All the elephants are trying to get through the key hole at the same time.   You can see this behavior manifest itself quite frequently.   A stock that had been moseying along, all of a sudden jumps 10% over night.  Earnings and other information are typically released after the market closes or before it opens. Sometimes a stock just catches fire (or dumps) for no obvious reason – no news.  My guess is that some insider is buying (selling), or something leaked.   So when I see this kind of stock behavior, I watch the MACD. I go to one of the lower time frames, such as 1 hour or even 30 min, to watch the buying (or selling) frenzy taper off.  That’s when I jump out (or jump in, if it’s a decline).   If I’m jumping out, I take my money and run, and I’m exceedingly grateful for the pop.  I’ll redeploy my capital elsewhere.   Usually when a stock pops like that, it’s an overreaction that doesn’t last.  And vice versa.  

The second way I fight my fight is by having only solid companies in my stable and by sticking to my limits during normal trading.  That way, if the hedge funds decide that they hate a particular stock all of a sudden, and the price plummets, I know I’ve got basically good companies in my stable, many of which pay dividends, and that they’ll eventually recover.  Just because a company disappoints a bunch of Wall Street hedge funds, or they perceive more opportunity somewhere else, doesn’t mean a stock isn’t still good. 

The third way I fight my fight is by not being excessively greedy.  A little greed is ok in this game, but you don’t want to be stupid.   As Warren Buffett says, be greedy when others are fearful and fearful when others are greedy.  Bulls make money, bears make money, hogs get slaughtered – as the old saying goes.   I have my annualized return hurdles, and they’ve been set empirically using the model – I’ve seen over time what the market can deliver on selling puts and calls on the stocks in my stable, at the point of a bottoming or topping MACD.  When the set up looks right, and the return is over my hurdle rate, I do the deal and I don’t look back and worry about whether I could have gotten a better deal.  Naturally, on any given trading day, I seek to deploy available cash as opportunistically as I can, within the limits I set for each stock.

Lastly, I try to be well diversified, not just for risk reasons but to generate opportunities.  40 companies are in my stable, across a variety of industries; this is pretty good diversification.  No one stock will make or break me.  I win by getting a lot of turns at bat, and by hitting singles and doubles on a lot of stocks – not by seeking grand slams on a few. 

These are just simple guidelines I’ve learned to follow.     Well, that’s all folks.  That’s my story and I’m sticking to it.   Happy trading. 

Next in sequence: Trading Parameter Optimization

Back to Home