# Trading Options at Expiration: Introduction and Explanatory Notes

• Print
This chapter is from the book

## Working with Minute-by-Minute Data

Expiration trading provides enormous opportunities that scale with the amount of time and effort an investor is willing to spend. It is certainly reasonable to study options expiration by observing the behavior of individual stocks, and to profitably trade the opportunity using principles outlined in these pages. That approach represents one end of the spectrum. The other end involves the development of custom databases and software. Although most investors are probably not inclined to build their own databases, many will discover that much of the statistical analysis mentioned in these pages can be compiled with little effort and no programming using the capabilities of Microsoft Excel. Following are a few simple examples.

The first, and probably most relevant for the present discussion, is the determination of the nearest strike for each closing price. This value can be determined for stocks having \$5 spacing using Excel’s rounding function, as follows:

`Strike = (ROUND (Close /5)) *5`

Assuming that each line of the spreadsheet contains data for a single minute, the formula can simply be pasted down a column of the sheet to create a running list of nearest strikes. Adding another column that calculates the difference between strike and closing prices takes just a few moments. The calculation would use the absolute value function:

`Difference = ABS (Strike - Close)`

Extending this operation with a simple conditional if/then statement enables us to determine the number of minutes where the closing price was more than \$2 from the strike price. The following statement marks rows that exceed the \$2 threshold with the number 1:

`If (ABS (Strike - Close) > 2, 1,"")`

As before, pasting the formula down the spreadsheet automatically marks all appropriate rows. Summing the results and dividing by the number of minutes (rows) gives the percentage chance of any minute closing more than \$2 from a strike.

Finally, we can execute more powerful conditionals without adding much complexity using Excel’s AND, OR, and NOT functions. Marking and counting the number of minutes containing a strike cross can be accomplished as follows:

`If (AND (High>Strike, Low<Strike),1,"")`

As before, summing the column yields the total number of minutes meeting the criterion—in this case, a strike price cross. The design assumes that only one strike price will be crossed in a single minute—an assumption that turns out to be true virtually 100% of the time. More complex logical structures can be designed for situations where a single record can contain multiple strike price crosses; the general case, designed for any length record, is best deployed as part of a program linked to a database. A fully functional example written in Excel VBA is listed in Appendix 1, “Excel VBA Program for Counting Strike Price Crosses.”

These examples represent only a tiny fraction of the statistical queries that can be constructed in just a few minutes using minute-by-minute data imported into a spreadsheet. Surprisingly, this capability is relatively new; older versions of Excel (pre-2007) were limited to approximately 65,000 rows per worksheet—less than a single year of minute-by-minute data. Before the introduction of Office 2007, large amounts of information could be managed only by using a database and custom software. The combination of fast multiprocessing desktop computers and large-capacity spreadsheets now makes it reasonable for nearly anyone to purchase and analyze very large datasets. Current Excel worksheets can handle more than 1 million rows and 16,000 columns.

Ambitious investors with programming experience will want to take the next step by constructing databases and writing custom software. The information used throughout this book was stored in a database constructed with Microsoft SQL Server. The complete database contains millions of records along with custom programs and SQL queries. Despite its complexity, none of the work is beyond the capabilities of a determined investor with a desktop PC and Microsoft Office software. Furthermore, single-user versions of Oracle and IBM DB2 databases are also available for free download from company websites. These “developer” versions are very powerful and can be expanded to full corporate licenses with unlimited storage capacity and advanced security features.