Wednesday, June 23, 2010

Selling Puts Vs. Selling Calls (Options Strategies)

This discussion outlines some of the simple differences between selling puts and selling calls.  To start with, it is good to understand that options trading, stock trading, and investing in the stock market can be risky.  Because of this risk, most investment houses require individual investors to use either covered calls, or cash covered puts.  

This article will focus on the situation where an investor is limited to 100% covered calls, and 100% cash covered puts.  Investors that are willing to assume more risk and leverage should take the quantitative principles outlined here, and apply them to the more highly leveraged margin based naked puts and naked calls.

Quick background:
First a quick refresher on buying and selling call and put options. With options there are basically 4 positions that you can take:
  • long the call option - in this case you are buying a contract that gives you the right to purchase an underlying on or before a future date at a predetermined ‘strike ’ price. You give up some money so that you can hold this right.
  • short the call option - in this case you are the party that sells a contract which gives someone else the right to purchase (from you) an underlying on or before a future date at the strike price.
  • long the put option - in this case you are buying a contract that gives you the right, but not the obligation, to sell an underlying on or before a future date at the strike price.
  • short the put option - in this case you are selling to someone else a contract that gives them the right, but not the obligation, to sell an underlying (to you) on or before a future date at the strike price.
Each of the four options mentioned above can be either in or out of the money.

 In order to fully understand Covered Calls, please see the article:
Buy-Write or Covered Call Strategy Analysis

Ground Rules:
Based on the ground rules which will be enforced here, an investor wanting to engage in selling calls will have to make 2 transactions each time he/she enters into the contract.  The investor will have to buy n*100 shares of a given stock or ETF, and sell n call contracts against it.  Some brokerage houses will actually make this a single atomic transaction.

Covered Call Outcomes:
  1. Stock price stays below the call strike price.  The option expires worthless, and the investor keeps the proceeds.
  2. Stock price moves above the call strike price, and the investor is forced to sell the stock at the strike price to a counter party.

In case 1, if the stock price remains relatively unchanged, then the investor did good because he/she generated cash flow from the owning of a stock.

In case 2, the investor did ok because he/she made money.  Which is good.

There is also a 3rd case, the stock drops in price.  This is the worst possible case because due to the investors long-stock position, the investor will loose money.

This position has 2 somewhat unfortunate issues, the first is that a strong bull market will outperform a covered call strategy, and in a bear market, an investor will only have the protection of the premium generated from the sale of the call. 

The maximum upside is the capital gain from the stock plus the proceeds from the sale of the call option.

In a very strong bull market, it is difficult to get out of this position before expiry.   What that means is that you may have a large amount of cash "tied up" and waiting for expiry.

Cash Covered Put:

Here one is selling a put, and using "Cash" to back the contract.  In this case, only 1 trade is required, that trade is the sale of n put contracts. 

This position allows an investor to exit the position very easily in a bull market because the investor can buy back the put cheaply in the event of a bull market, and if desired immediately re-sell another n put contracts with a higher strike price.  Because of this, this strategy does not have the opportunity cost associated with being forced hold an strategy until expiry.

Issue: in a strong bear market, this investor is forced to "buy" a depressed stock above the fair market value. 

Strategies to "Hedge" against a bear market include selling in-the-money puts, and buying out-of-the money puts.  This allows the investor to capitalize on the bull market, while protecting from a bear situation.

Concrete example:
6/22/2010:
Sell 4 contracts of Ford with a strike price of 12.00 USD,
Buy 4 contracts of Ford with a strike price of 10.00 USD,

Cash IN       292.98 (76 *4 - commission)
Cash OUT     44.01 (9*4 + commission)

At Expiry, the payout will exactly match the "intrinsic" value of the position:
Therefore, the maximum profit will be  292.98 - 44.01 = 248.97
The maximum loss will be 800.00 - 248.97 = 551.03

Max Profit:  248.97
Max Lost:    551.03

However, with options, at any time before expiry, the maximum loss will be less than 551.03 because as the stock price drops the put with a strike price of $12.00 will approach the intrinsic value, whereas the put option with a strike price of $10.00 will be composed mostly of its implied volatility value.

Of course as an investor if you find yourself in a position where the stock has taken a loss, you will have to make the decision to "close" out the position at a loss before expiry to ensure that you don't get caught with the maximum lost of 551.03.

Wednesday, March 03, 2010

Quick Notes and Tips On VMware Tuning

This is by no means a comprehensive of detailed list of tuning of a VM running in VMWare's ESX server.  However, I wanted to add a couple of hints or tips that others my find useful.

Windows as the Guest OS:
  •  High Context Switching:  If you are experiencing high context switching, it is best to try to understand why.  Several Things can cause this:
    • COM+ calls to out of process COM+ servers
      You may want to sacrifice memory and security by making the COM+ server an in-process call. This can reduce context switches.
    • System Calls
      Not much you can do here. 
    • Large Numbers of Threads running
      Reduce the number of threads that are servicing requests, for IIS you can just reduce threads, for a home grown application this will be done progromatically and should be configurable.
    • Page Faults
      This is a tricky one:  you may want to understand your "Working Set" size and ensure that your applications "Working Set" size is set large enough to accomodate all memory pages. Windows uses a 4K page Size or 4096 bytes per page, and working sets by default hold about 300 or so pages of memory.
ALL Virtulization Environments:
  • Disable all Screensavers, animations, or Xservers on Linux or windows.  Any background processing will be counted by VMware's virtulization statistics.  This also means that you should have any Virus Scanners well-tuned such that you are not doing on-access demain scanning for known secure directories.
  • Disconnect all unused devices on both the host and guest operating system.
  • CPU Bound Applications:  for applications that are CPU bound, CPU Virtulization will cause a degradation in performance.  For applications that are not CPU bound CPU Virtulization will have little perfromance degradation.
    • Use the minimum number of Virtual CPUs possible.
    • Note that in some guest operating systems, the Idle loop (nothing on the processor) still counts against that Virtual CPU in the VMware CPU statistics.
    • Multithreaded applications - Pin guest threasd or processes to Virtual CPUs.
    • Monitor the Idle Loop Spin Parameter.
    • Monitor the Service Console Activity with esxtop.
  • Memory Overhead
    • Virtulization Translation Activities.  OS (the guest os) will abstract memory for each process.   When the process needs to access memory, it will request that memory.  Here is the High level of what happens:
      • Request memory -> translate to Relative Page.
      • Guest OS Segments page -> get OS's physical Address.
      • VMWare translates OS's physical -> Get Real Physical Page.
    • Usage Overhead.  
      • Service Console uses < 300M.
      • VMWare kernal  uses a small amount of memory for various data structures.
    • Host memory Sizing - make sure that the host OS has more physical memory than all the ESX overhead plus the maximum of all the working set sizes of all the running applications in all the VMs.
    • Allocate Enough memory to each VM to hold all the workings sets of all the applications that will be run in that VM.
    • If Over Committed Memory is too large, the ESX sever may start swapping.  This will degrade performance significantly.
These are just some of the simple low-haning fruit.
VMWare has published a very comprehensive document:
www.vmware.com/pdf/vi_performance_tuning.pdf


    Friday, February 19, 2010

    Buy-Write Options Strategy (AKA Covered Call)

    The Buy-Write Options strategy (AKA covered call) is starting to gain some attention again.  The reason it is starting to gain attention again is because it is effective at reducing the impact of a bear market on your overall portfolio value, and because it is highly effective at generating cash flow during a neutral market.  The strategy will however consistently under perform the market during a bull run.

    Advantages of the Covered Call:

    • Generate Cash Flow from your long portfolio.
    • Reduce the effect of market volatility
    • Reduce your un-realized losses during a bear market.

    The strategy amounts to 2 simple steps:


    1. Buy N 100 share blocks of the stock where N is some integer 1 or more. This will obviously depend on how much money you have to invest. Some stocks that trade for 5 dollars will only cost you 500 dollars per block, while other stocks like Berkshire Hathaway will cost 11,000,010.00 per 100 share block as it is trading at 110,000.10 per share at the time of this writing. Also, just for completness BRK-A does not have exchange traded options written against it.
    2. Sell N Call contracts against the stock or ETF you just purchased, where N is the number of blocks you bought. The selling of the call will generate cash (put money into your account). However, if the call expires in the money you will be forced to sell the N blocks of stock you just bought.
     The image below shows the maximum profit that the portfolio can achieve during a "bull run" which shows the significant limitations of the strategy in a bull market.

    This posting is intended to wet your appetite for understanding the Buy-Write strategy.
    Much greater detailed discussion is presented at:
    Quantprinciple's Buy-Write/Covered Call Strategy

    And of course if you like the article, please digg it: http://digg.com/d31JMd3


    Q. Boiler

    Thursday, February 04, 2010

    A solution to the VirtualBox Under Linux Running a Windows Server 2003 Hangs

    VirtualBox is Free, runs on Windows, Linux, Mac, and other OSes.  Virtual box is lightweight and has some other nice features.  

    Using Sun's virtual box (Sun is no more, Sun got engulfed by Oracle) on Linux to run a Windows 2003 Server, I was not able to get the Server to start up.  The Server Windows 2003 VM would just hang when I pressed the run button.  So after searching a bit, I stumbled on the solution.  I am posting it back to this blog just to make it a bit easier to find the solution for others.


    The solution to this hang issue is to make sure that you check the "Enable IO APIC" box.  To find this box, go to:
    Settings -> Select "System" in the left -> "Motherboard" tab
    See the attached image:

    Monday, November 23, 2009

    Risk Reversal or Synthetic Long Stock Position

    A "Risk Reversal" or Synthetic Long position is where an investor will simultaneously buy and sell, out-of-the-money options with the goal of simulating a long stock position.  However, the goal of the synthetic position is to obtain much higher leverage, and reduce the down side risk.  After hearing the folks at fast money talk endlessly about this position, I decided to create a document so people can study it and think Quantitatively about it.  The full article is at: 

    http://www.quantprinciple.com/invest/index.php/docs/quant_strategies/riskreversal/

    Here is the Abstract:

    Abstract
    This article discusses a form of Financial Derivative investment strategy called a ‘Risk Reversal.’ A ‘Risk Reversal’ is also referred to as a ‘Synthetic Long’ in some literature. The article explains the theory, and shows you what risks you are exposed to. It also shows you how to protect your investment once the market has moved in a favorable direction. The theory, the mathematics and a theoretical example are presented. If you would like to contact the author, send a message to q.boiler@QuantP rinciple.com  . If there are any errors, typos, or defects with this article please make the effort to contact the author.


    Once you have read the article please discuss below (good or bad!).
      

    Wednesday, November 18, 2009

    How to Nohup an already running unix process

    Starting a job at a Unix Command prompt will cause that job to be attached to the shell that started the job. If that shell is terminated, the job(s) that were started under it will be terminated as well. This is caused by the fact that when a UNIX process ends all the processes contained within that processes' process tree are also terminated.

    If you have ever had the need to nohup a unix job that was already running, then I have the website for you. http://www.quantprinciple.com/invest/index.php/docs/tipsandtricks/unix/jobcontrol/ This website shows how to disown, nohup, suspend and resume jobs in UNIX.

    Nohup stands for no hang-up. When a process is started in the nohup mode, then when the parent shell or process dies, the child process will not die. Disown is a built in bash command that allows you to nohup jobs that are already running.

    Keep in mind that jobs and processes are to different things. Jobs are tasks or processes that are tied to a shell. Whereas processes are operating system notions. The above mentioned website gives a very clear description of job control in UNIX.

    If you are impatient, and just want a command that will most likely do what you want:
    prompt% disown -ar

    If you are pretty comfortable with UNIX and UNIX job control, then
    prompt% man bash
    and search for disown

    If you need a bit of help understanding jobs, processes, and job control then
    http://www.quantprinciple.com/invest/index.php/docs/tipsandtricks/unix/jobcontrol/

    BTW
    I BECAME AN UNCLE TODAY!

    Wednesday, November 11, 2009

    Chicago Quant Meetup Group Started

    The Chicago area now has a Quant Meetup group.
    http://www.meetup.com/ChicagoQuants

    This group will meet to study and understand Quantitative topics in financial engineering. Typically this group will be working through a chapter each month from a well known book in quantitative finance. However, this group is by no means an academic only group. Some of the group members will form organizations to try out the strategies studied in the real world (By actually pooling capital together and forming an investment club or joint venture). Topics that will be discussed: Volatility, Delta Neutral Hedging, Leverage, Risk Arbitrage, Statistical Arbitrage, Strangles, Straddles, Barrier Options, and other strategies.

    ALL levels of quantitative financial engineer or investor wishing to understand will be welcome.

    ALL members should be willing to chip in a few bucks each month to help defer the cost of a meeting place, and printing of some handouts, plus coffee.

    ALL Members are expected to do some reading and preparation before each meeting.

    There is NO NEED to have a Ph.D. some knowledge of Calculus is helpful, but almost all of the concepts can be picked up and understood with just an inquisitive mind. That said, Ph.D.s are more than welcome.


    About the meetings, we will meet 1 or 2 times per month depending on needs. The meeting will be about 2 hours long, 50 minutes of a presentation, followed by open discussion/questions, and finally a social period over some coffee.

    Thursday, November 05, 2009

    Unix Script To Suspend Resume a Process

    Have you ever wanted to programmatically suspend and resume a Unix process. Possibly setting up to do this in a periodic fashion for N cycles. This can be done easily using Unix signals such as SIGSTOP, and SIGCONT. The SIGSTOP will cause a process to suspend but not stop, and the SIGCONT will cause the process to resume.

    So the trick is to determine the PID for the process you want to suspend or resume, and then set up the parameters governing the amount of time you want the process to sleep and run. Additionally, you may want to control the termination of he underlying process based on a number of cycles, time, or some other criteria. Well I have found an excellent script to do just that:

    A brief discussion can be found at Discussion.
    Of Course, for the impatient a The Script.

    Dark Pools in Equity Markets

    I had written up a discussion of Dark Pools in equity markets at QuantPrinciple.com see Dark Pools. I am entering the main text here.

    Dark Pools in the Equity Markets

    What are dark pools? Dark pools are large blocks of equities traded off the exchange floor. In order to understand dark pools, and how they arose, we first must look at why they would even arise in the first place. As Mutual Funds, Hedge Funds, Pension Funds, Insurance Funds and other large blocks of equity increased in size, it became much more challenging for these entities to move their money in and out of a stock. Funds started to look at strategies for how to move money into and out of stocks. These strategies would get quite complex, and would have Quants (typically Ph.D.s in Mathematics or Quantitative Finance) develop them. The strategies were typically assembled by a team of quants, and carried out by a team of traders. However, as soon as a fund's "hat was tipped" other traders would start to take advantage of that knowledge, thus moving the price of the underlying in a disadvantageous direction. Therefore, the Quants would develop strategies that were unpredictable. These could include buying or selling options or other derivative type contracts to allow for protection as the funds tried to move large amounts of equity in or out of an underlying stock.

    This worked well while trading was done mostly on the floor. Times changed. Trading moved to electronic systems which are far more analytical and far more sophisticated. Possibly the most significant aspect of the electronic trading and clearing is that the time scales decreased. An equity's price can move much more rapidly today than it could in an open call system. Digital computers are far less forgiving than market makers standing on the floor of the stock exchange.

    All these factors lead to the natural desire for a third party to find a more efficient way to move large blocks of equities, without forcing the price up or down in the process. Dark pools allow funds to quietly trade large blocks of stock in the same manner that smaller players can trade. This is really very important for the liquidity of the market because the large player and the small players are really two different equity pools. Therefore, making the large funds play in the small pool of equity would mean that every move they make drives the price in that direction.

    Consolidated Tape

    Dark pools are recorded to the national consolidated tape. However, they are recorded as over-the-counter transactions. Therefore detailed information about the volumes and types of transactions is left to the crossing network to report to clients if they desire and are contractually obligated.

    Dark Pool transactions are recorded on the exchange's consolidated tape. The SEC, and anyone else that wants to purchase the consolidated tape, has some limited visibility into those transactions.

    Saturday, October 31, 2009

    Unix Utils For Windows

    Years ago I had stumbled on this rather cool project UnixUtils at sourceforge.net
    The project is a complete native port of most of the common unix utils for windows.

    Choose these Utils A La Carte style at Quant Principle's Unix Utils Page.

    While I am aware of the fact that most hard core unix gurus will just install cygwin or possibly get the z-shell to work on a windows environment, Some people would just like to copy one or two (or 12) of their favorite unix utils to a windows box. In personally find that if you have wc (word count), tail, less, ls, grep, egrep, cat, bunzip2, bzip2, chmod, cksum, diff, gawk, gunzip, gzip, make, patch, sed, touch, ufind (I renamed find to ufind so it would not conflict with the dos version of find), unrar, zip and unzip; with these executables you will be able to function very nicely on a windows box.

    When I pull these files onto my box, I place them in c:\usr\local\bin. However if I am on a foreign system that does not have unix utils installed, I will just grab the one or two I need from the Quant Principles Unix Utils List, and place them in the [windows]\system32 directory. That directory is Alwasy in the path. it is usually located at c:\windows\system32

    You can get the official source and binary from unixutils on sourceforge.net, or you can download the bianaries individualy at Quant Principles Unix Utils List.

    Wednesday, October 28, 2009

    Inertial Confinement Fusion

    What does Inertial Confinement Fusion have to do with Quantitative Finance?

    Not Very Much. However it does have 1 thing in common, me. Prior to working in finance, I spent time working on helping to solve the Inertial Confinement Fusion problem. What is Inertial Confinement Fusion (ICF)? ICF is a technique to use LASER light or particle beams to compress fusion able fuel such as D-T. There are many issues with this concept. One of the most significant issues is the fact that in order to compress a fuel pellet to the number density required to achieve fusion, fluid instabilities arise which tend to disrupt the compression phase of the cycle. My thesis studied Numerical Modeling of the Rayleigh-Taylor and Kelvin-Helmholtz instabilities. You can find an HTML version of the thesis at http://quantprinciple.com/qboiler/icf.html.



    ICF as a concept is very similar to the internal combustion engine. While I was working on my thesis, I drew a picture that showed the phases of ICF, verses the phases of the internal combustion engine.


    Why am I putting this out now? I finished up my thesis in 1995, using latex209 (before the real latex; back in the day when you used .sty files instead of .cls)
    Because some of the articles that I have been working on for QuantPrinciple.com are mathematically rigorous, I decided to dust off my latex skills, and write the articles using latex. In doing that I decided to see if I could get my thesis to compile in latex (it did) but I could not get htlatex to make my thesis into a web page. So I translated the latex209 code of my thesis to standard latex. Once I did that the htlatex worked pretty well (There were several places it should have put a br page break and didn't, also it did not size images properly.)

    Monday, October 26, 2009

    Delta Neutral Hedging

    Delta Neutral Hedging is a concept of creating a portfolio which has a net value that is kept neutral to movements in the underlying stock price. By dynamically re-hedging an investor is able to effectively buy low and sell high. This is the concept of a good investor. Quant Principle has an excellent article discussing delta neutral hedging.

    This article discusses Delta (δ) neutral hedging, and Delta (δ) neutral dynamic hedging. The article discusses the theory, the mathematics and a theoretical example. The example sets up a very simple portfolio that contains a long Call Option, and a short position on the underlying stock. The simple strategy demonstrates the concept of trading on volatility.

    Finally, the article presents a brief discussion of the risks associated with Delta Neutral hedging.