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.

Thursday, October 01, 2009

Investment Clubs

Well since Mr Madoff (Bernie Madoff) created the greatest pyramid scheme of our time, I have been wondering if money managers are over rated. To that end I started looking at other options. That is other options to money managers. Well, there are mutual funds, which are much more regulated. However, mutual funds especially actively managed ones can have fairly significant fees. Investigating further, I found quite an intersting alternative. The great thing about this alternative is that it has been demonstrated to give as good a return on investment as some of the best managed funds in the world, with a much lower cost and fee structure. The alternative is an investment club.

An investment club is a group of people who form a corporation, LLC, or joint venture; and pool there collective funds together for investing. The advantage is that a small group of modest investors can pool enough funds together to get very low transaction costs, and have a very low management fee.