Oil, oil, oil...has it made you a fortune in the last two weeks, or are you ready for US energy to go green and your portfolio to follow suit?

For my first quantitative study, I'll demonstrate how a relatively simple analysis may lead you to rethink your portfolio. Correlation (or covariance, roughly) is a common measure used across science, economics, and various other disciplines. In short, it measures how accurately the change in one variable (stock price X, say) mimics the change in another variable (stock price Y, say). Correlation maxes out at 1, and the higher the correlation the more X mimics Y. Alternatively if the correlation is -1, it means X does the exact opposite of Y, and vise versa. A correlation of 0 indicates no real relationship between the two.

We can take this one step further and, for example, look at how stock price X, 5 days ago, correlates to stock price Y, today. One can imagine that if there is some correlation between a previous value of X, and a current value of Y, then X would make a fine (potentially profitable) predictor of Y.

For simplicity purposes we will substitute the actual oil commodity for a liquid, commonly tradable alternative, The United States Oil Fund USO. So lets take a look now at 2 years of data from USO (red) and the Dow Jones Industrial Average (blue).

To the naked eye one might see a little bit of similarity, but definitely nothing to justify 20 hours of airtime on CNBC right?

Well, lets delve deeper....

Above, we have the correlation coefficients between the price of USO and the DJIA, calculated over 250 days, for different lags of USO. Anything above 0.2 or below -0.2 is statistically significant... so basically nothing. Somewhat surprisingly, the market seems to do better for a few days following a rise in oil prices, but falls a week or so after. None of these values are significant however, so we're really pulling at straws here.

So how exactly can you invest on this? What it indicates is that the absolute price of oil really doesn't tell you at all where the market is headed. If the economy is booming, and the traders are paying a lot for oil, then both may go up in coincidence. Alternatively, much like recent events, some international conflict may be causing the price of oil to rise, and the market to concurrently fall. The figure below is the correlation of USO on the DJIA over the past 50 days. It even suggests that as oil goes up so does the market!

So if you want to play the market vs. oil, or have a well diversified portfolio containing oil, it might just be best to avoid reading the market section of the WSJ, and to stick to the front page.

Troy Lau

Disclosure: I have no positions in any stocks mentioned, and no plans to initiate any positions within the next 72 hours.

If you frequent investor websites, message boards, or pretty much anywhere on the internet, you’ve undoubtedly seen numerous ads tipping you off to stocks that are ready to EXPLODE with gains of 50%, 500%, or even 5,000%! Well 50,000% of the time, these advertisements are just pump-and-dump schemes ready to take your money instead. But is there really a way to mathematically measure the ‘explosiveness’ of a stock you may own, or want to own? In this post I’ll present you with a relatively simple technical indicator that can give you insight into the explosiveness of a stock. You don’t need a massive database of market info or a strong background in computer programming to implement this one. A visit to a website with historical data like Yahoo! and a working knowledge of Excel will do just fine.

The first question we need to ask is, ‘How much ground (price) has a stock covered in a certain day?’ The answer to this question tells how volatile the stock is, an important indicator of its potential to increase or decrease in price. The simplest measure of this is the difference between the high and the low prices for the day, divided by the open.

(Phigh – Plow) / Popen

Unfortunately, this only tells us the percent range the stock has oscillated between throughout the day, not the actual price range it has covered. A better assumption uses the idea that stock prices follow a random walk (to a good approximation). Sparing you the gory details (read: Gaussian random walk), a better estimate of price range a stock has traveled within a day is

STDprice * sqrt(Volume).

The second term is just the square root of the volume for that day, and comes from the root-mean-square of random walk steps. The first term, STDprice , is the standard deviation of the price for the day, assuming a Gaussian distribution of prices. If we assume the price highs and lows for the day are 2 standard deviations away from the mean (for those worried about this assumption, it will just add an arbitrary scaling factor to the

measure, which has no effect), then our new equation becomes…

We are almost there. If this equation gives us a good estimation of the price range a certain stock has traveled through in a day, then all we need to do is divide this by the volume of shares traded. Multiplying this by 100 gives us the percent change in the stock price each traded share caused, or as I like to call it, the

What this tells us is how much of an effect buying or selling a single share will have on the stock price. Let’s look at some examples and see how it works.

We see, both with STEC’s epic 1 year run, and AVNR’s up and down rise, that the SSI (bottom, blue) did a nice job indicating the stock price’s (top, red) ability to move. Just before STEC’s run (early 2009) a trade of only 1000 shares (<$10,000) could move the stock 3%. This was a marked sign of illiquidity, and preceded massive gains in price.

So I’ve given you the golden indicator that will make you all millions, right? Umm… not quite. Keep in mind that this is a measure of volatility-per-share, or how much it will go up or down, not IF it will go up or down.

Here’s a case in point with DRYS. Notice how SSI took a nice little jump just before the epic fall in price and epic rise in SSI; the measure works both ways. Look below; it even identified some of the rises and falls of the great recession.

So how can you use this to make yourself money? One obvious way is in options trading, with both a call and put option well outside of the money. One option will end up worthless but the other could increase N fold, always a good investment. Another potential application is when you are very confident a stock will go in a certain direction and you want to maximize profits. It also could be used nicely in combination with short data as well, maximizing the BANG of a short squeeze. In the end, use it how you see fit. It obviously doesn’t work 100% of the time, and the SSI can remain arbitrarily high for any length of time. But, used properly it can be a nice addition to your technical analysis toolbox.

Dr. Troy Lau

Disclosure: I have no positions in any stocks mentioned, and no plans to initiate any positions within the next 72 hours.

Instablogs are Seeking Alpha's free blogging platform customized for finance, with instant set up and exposure to millions of readers interested in the financial markets. Publish your own instablog in minutes.

## View troylau's Instablogs on:

## Making money on oil, without actually owning it.

Visit my blog at http://thequantinvestor.blogspot.com/

...has it made you a fortune in the last two weeks, or are you ready for US energy to go green and your portfolio to follow suit?Oil, oil, oil

For my first quantitative study, I'll demonstrate how a relatively simple analysis may lead you to rethink your portfolio.

Correlation (or covariance, roughly) is a common measure used across science, economics, and various other disciplines. In short, it measures how accurately the change in one variable (stock price X, say) mimics the change in another variable (stock price Y, say). Correlation maxes out at 1, and the higher the correlation the more X mimics Y. Alternatively if the correlation is -1, it means X does the exact opposite of Y, and vise versa. A correlation of 0 indicates no real relationship between the two.We can take this one step further and, for example, look at how stock price X, 5 days ago, correlates to stock price Y, today. One can imagine that if there is some correlation between a previous value of X, and a current value of Y, then X would make a fine (potentially profitable) predictor of Y.

For simplicity purposes we will substitute the actual oil commodity for a liquid, commonly tradable alternative, The United States Oil Fund USO. So lets take a look now at 2 years of data from USO (red) and the Dow Jones Industrial Average (blue).

To the naked eye one might see a little bit of similarity, but definitely nothing to justify 20 hours of airtime on CNBC right?

Well, lets delve deeper....

Above, we have the correlation coefficients between the price of USO and the DJIA, calculated over

250days, for different lags of USO. Anything above 0.2 or below -0.2 is statistically significant... so basically nothing. Somewhat surprisingly, the market seems to do better for a few days following a rise in oil prices, but falls a week or so after. None of these values are significant however, so we're really pulling at straws here.So how exactly can you invest on this? What it indicates is that the absolute price of oil really doesn't tell you at all where the market is headed. If the economy is booming, and the traders are paying a lot for oil, then both may go up in coincidence. Alternatively, much like recent events, some international conflict may be causing the price of oil to rise, and the market to concurrently fall. The figure below is the correlation of USO on the DJIA over the past

50days. It even suggests that as oil goes up so does the market!So if you want to play the market vs. oil, or have a well diversified portfolio containing oil, it might just be best to avoid reading the market section of the WSJ, and to stick to the front page.

Troy Lau

Disclosure:I have no positions in any stocks mentioned, and no plans to initiate any positions within the next 72 hours.## The Share Strength Indicator: How much BANG is in your stock?

If you frequent investor websites, message boards, or pretty much anywhere on the internet, you’ve undoubtedly seen numerous ads tipping you off to stocks that are ready to EXPLODE with gains of 50%, 500%, or even 5,000%! Well 50,000% of the time, these advertisements are just pump-and-dump schemes ready to take your money instead. But is there really a way to mathematically measure the ‘explosiveness’ of a stock you may own, or want to own? In this post I’ll present you with a relatively simple technical indicator that can give you insight into the explosiveness of a stock. You don’t need a massive database of market info or a strong background in computer programming to implement this one. A visit to a website with historical data like Yahoo! and a working knowledge of Excel will do just fine.

The first question we need to ask is, ‘How much ground (price) has a stock covered in a certain day?’ The answer to this question tells how volatile the stock is, an important indicator of its potential to increase or decrease in price. The simplest measure of this is the difference between the high and the low prices for the day, divided by the open.

(Phigh – Plow) / PopenUnfortunately, this only tells us the percent range the stock has oscillated between throughout the day, not the actual price range it has covered. A better assumption uses the idea that stock prices follow a random walk (to a good approximation). Sparing you the gory details (read: Gaussian random walk), a better estimate of price range a stock has traveled within a day is

STDprice * sqrt(Volume).The second term is just the square root of the volume for that day, and comes from the root-mean-square of random walk steps. The first term, STDprice , is the standard deviation of the price for the day, assuming a Gaussian distribution of prices. If we assume the price highs and lows for the day are 2 standard deviations away from the mean (for those worried about this assumption, it will just add an arbitrary scaling factor to the

measure, which has no effect), then our new equation becomes…

STDprice * sqrt(Volume) = (Phigh – Plow) * sqrt(Volume) / 4*PopenWe are almost there. If this equation gives us a good estimation of the price range a certain stock has traveled through in a day, then all we need to do is divide this by the volume of shares traded. Multiplying this by 100 gives us the percent change in the stock price each traded share caused, or as I like to call it, the

Share Strength Indicator(SSI).SSI = 100* (Phigh – Plow) / (4*sqrt(Volume) Popen)What this tells us is how much of an effect buying or selling a single share will have on the stock price. Let’s look at some examples and see how it works.

We see, both with STEC’s epic 1 year run, and AVNR’s up and down rise, that the

SSI(bottom, blue) did a nice job indicating the stock price’s (top, red) ability to move. Just before STEC’s run (early 2009) a trade of only 1000 shares (<$10,000) could move the stock 3%. This was a marked sign of illiquidity, and preceded massive gains in price.So I’ve given you the golden indicator that will make you all millions, right? Umm… not quite. Keep in mind that this is a measure of volatility-per-share, or how much it will go up or down, not

IFit will go up or down.Here’s a case in point with DRYS. Notice how SSI took a nice little jump just before the epic fall in price and epic rise in

SSI; the measure works both ways. Look below; it even identified some of the rises and falls of the great recession.So how can you use this to make yourself money? One obvious way is in options trading, with both a call and put option well outside of the money. One option will end up worthless but the other could increase N fold, always a good investment. Another potential application is when you are very confident a stock will go in a certain direction and you want to maximize profits. It also could be used nicely in combination with short data as well, maximizing the BANG of a short squeeze. In the end, use it how you see fit. It obviously doesn’t work 100% of the time, and the

SSIcan remain arbitrarily high for any length of time. But, used properly it can be a nice addition to your technical analysis toolbox.Dr. Troy Lau

Disclosure:I have no positions in any stocks mentioned, and no plans to initiate any positions within the next 72 hours.