In regard to stocks, options are an interesting investment vehicle. Some say it is gambling, while others insist it is investing. Depending on your approach it might be insurance if you underwrite puts and calls. Either way an interesting problem domain from the standpoint of analysis.

There are two primitive transactions within options: call and put. Both are centered around a strike price on an underlying asset which a premium is paid for. A call is underwritten to provide stock sold at the strike price when the underlying asset is sold above the given price within a given time period. A put is underwritten to purchase stock at specific strike price when the underlying asset falls below the agreed upon strike price. As you can imagine these primitive provides a lot of emergent behavior in how one can profit or lose significantly.

The Question?

My data source is a list of date ordered transactions regarding both stock and transactions. Here are the following questions I am attempting to answer:

  1. What is the given position of a stock and options at a given point in time?
  2. What assets are used to underwrite at a given point and time?

Until you add in options, answering the first question is simple. A stock is bought at a price, held until sold, then sold for a price. I generally use FILO model for matching pairs however there are other models such a FIFO which. Tax implications are a question for a future date.

I use cash secured puts and covered calls for underwriting. A cash secured put means actual cash is held in reserve, unable to be utilized in other trades. A covered call means the underwritten option is reserved for the specific call. These create a third state for both cash and stock: reserved by underwite. Typically, options periods are scheduled on to expire at the end of a week and several weeks out.

Report Output

For a given date, a report should contain something like the following:

  • Asset: This will be the stock and associated options which are traded against this asset. Each element will be split into lots which will be moved around.
    • Shares of stock uncommitted to any other resource
    • Underwritten calls
    • Underwritten puts