Showing posts with label Trading. Show all posts
Showing posts with label Trading. Show all posts

Sunday, February 15, 2009

Trading Principles - 3

In my previous post (Trading Principles - 2), we discussed two concepts:
(1.) Chance of winning
(2.) Risk:Reward

OK, lets move ahead.

Sometime last year, a friend asked me what I thought about the market direction. I replied that I thought markets would go up in the near term. So he further asked me whether I had bought in anticipation of this move (being long, in trader terminology). I replied in the negative saying that I was actually short on the markets.

My friend appeared puzzled, perhaps he thought I was being a 'wise guy'. In reality, I was being totally honest. But what explained the discrepancy between my views and my action?

Lets say you toss a fair coin. If you get a heads, you get paid Rs. 2. If you get a tails, you lose Re 1. Would you play this game of chance?

For a fair coin, there is a 50% chance of getting either heads or tails.
So if play this coin toss game 100 times, you can expect 50 heads and 50 tails.
For each head, you win Rs. 2. So for 50 heads you will win Rs. 100
For each tail, you lose Re. 1. So for 50 tails, you will lose Rs. 50.
After 100 tosses of this fair coin, you will win Rs 100 and lose Rs 50 for a net gain of Rs 50.
So if you play this game 100 times, you can expect to win Rs. 50.
Hence, the EXPECTED VALUE of the gain from a single toss of the coin is Rs 50 divided by 100 = Rs. 0.5.

You can expect to win 50 paisa for every toss of the coin. This is called the EXPECTED VALUE (E) per toss of the coin toss game. Surely, you would like to play this game, as many times as possible. The more you play, the more money you can make.

Likewise, each investment/trade has an expected value. If the expected value is positive, a profit is expected on the trade and it is worth taking. If the expected value is negative, a loss is expected on the trade and the trade is not worth taking.

Let us take a couple of examples.

Trade A has a 70% chance of winning and a 30% chance of losing. The win per trade is Rs 100 but the loss per trade is 400.
The expected value (E) for this trade is (0.7)*(100)+(0.3)*(-400) = -50
Trade A has a negative E value. i.e. this trade is expected to lose you money even though it has a 70% chance of success. Thus a high chance of success does not equate with making money.

Conversely turn the above trade on its head. Take trade B that has a 30% chance of winning Rs 400 and a 70% chance of losing Rs 100.
E for this trade is +50.
So even with a low chance of winning, the trade makes you money.

Perhaps now it might make sense why I was short on the markets in spite of thinking that the markets would go up. I was expecting that if the markets went up, they would not go up much. But they went down, they would go down a lot. The Expected Value favoured a short position.

It does not matter much, if over the long run, you are more wrong than right (% success rate) or vice versa. What matters is how much you make when you are right and how much you lose when you are wrong (a high average profit:average loss ratio).

So how do we use this to make real life decisions? Suppose you have a one year time horizon. At the end of 1 year, you expect the Sensex to have a 50% chance of going up by 30%. But there is a 50% chance of it going down by 20% as well. Should you buy?

The expected value from this trade is 0.5*30%-0.5*20% = 5%

This is positive. So should you buy since E has a positive value?

Do not forget the opportunity cost. You could put your money into a bank fixed deposit and get an assured 8% (assuming the bank does not default). So in actual terms, the opportunity cost for making the Sensex trade is higher than the expected benefit from this trade.

An investment must then must not only have a positive expected value but it must be higher than the best opportunity cost. Clearly, it does not make economic sense to buy into the Sensex with these kind of statistics.

What if your time horizon is 5 years?

Say, over 5 years, there is a 90% chance of the Sensex doubling in value. But there is a 10% chance of the Sensex going nowhere. The E for this trade is 90. The opportunity cost @8% per annum is 47. So over a longer duration, the trade makes sense.

(Hence the importance of a personal time horizon for any investment.)

So what lessons can we derive from the above discussion?
(1). More important than % success rate is the reward:risk relationship. It is easier to find investments and trades that have a low success rate than one that has a high success rate, provided you obey point no. 2 below, which is
(2). Let your profits run but cut your losses short. Look at trade B above. Many investors do the converse. They sell quickly when they have a profit, lest the profit should evaporate. But they hang on to losing investments in the hope that prices will come back. In effect they follow the strategy, 'cut your profits short but let your losses run'. Typical phenomenon are short term trades becoming long term investments, Buy-and-hope investing, not willing to accept a loss, etc. All lead to the poor house!
(3). Seek and act on only those investments that have a positive E value. Finding such trades requires possessing an edge in the markets. An edge comes from experience, vision and ability to foresee, access to information, plan and discipline, patience, perseverance, or all of the above, and more.

Till next time, happy investing!

Friday, January 30, 2009

Trading Principles - 2

Ok, so outcomes in the market are uncertain and there always is a chance of losing money. Investors need to think in terms of probabilities.

But how does one do that?

First, never invest with the thinking, "this will surely go up". There is no sure thing in the markets. Avoid the lure of the 'sure'.

When faced with a choice to invest or not to invest, ask yourself the question, "What are the chances of the price going up/investment working out and hence what are the chances of the investment not working out? Is it 80%? 60%? 40%? 20%? By doing so, you immediately get into the mental framework of assessing possibilities and awarding probabilities to outcomes.

So you might think that a particular investment has a 70% chance of making you money and a 30% chance that you would lose money (neglecting the possibility of the investment going absolutely nowhere) in a given time frame.

The key question is how do we assess these probabilities? Unfortunately there is no easy answer. Investors mostly depend upon their knowledge, experience and judgment.

But to help you make an assessment, you could look into history to see what happened under similar circumstances. So if a particular outcome X occurred 7 times out of 10 when conditions A, B and C were satisfied, you can say that maybe the chance of outcome X happening again, given the presence of conditions A, B and C is 70%.

Important to note however is that the past is merely indicative of the future. Never is the future exactly like the past. There could be factors that we miss out that could produce an entirely different outcome when compared to history. For example, it is commonly believed that an increase in money supply causes inflation. In an inflationary period, gold prices go up. So with all the trillions of dollars being thrown at the current economic problems worldwide, people expect the prices of gold to go up sometime in the future. But maybe, just maybe, we are not looking at the even greater amount of money being destroyed off balance sheets. So there could be a net money contraction and maybe gold prices do not go up.

You might be wondering whether experienced investors actually assess the probabilities in terms of such percentages. They don't do this on paper, but at a subconscious level, they get a sense of the odds. They may not be able to exactly spell out the probabilities, but in their minds, they are aware of the chances, at least at an approximate level.

Fine! So, at what percent chance of winning does an investment become a good investment?

If you flip a fair coin, there is a 50% chance of getting heads and a 50% chance of getting tails. These two outcomes are random in nature and depend purely upon luck. So if a random choice gives you 50% chance of winning, should an investment with a higher than 50% chance of winning be a better investment? After all should the odds of winning not be greater than random outcomes? Also, is an investment with a 80% chance of making money a better investment than that with a 70% chance of making money?

Not necessarily!

In reality, it does not matter much if you win or you lose. What matters is how much you win when your investment works out and how much you lose when it does not work out.

The amount you end up winning is your reward. The amount you were willing to lose is your risk.

A good investment is one which if it goes wrong, it goes a little wrong; and if it goes right, it goes significantly right. In other words, the reward to risk ratio is high.

Look for an investment/trade that has a high reward:risk ratio. Elementary, my dear Watson.

But why should an investment with a 70% chance of making money not necessarily be a good investment and why should an investment with a 70% chance of losing money not necessarily be a bad investment?

That is the topic of my next post...

Saturday, January 24, 2009

Trading Principles - 1

Can you have a process behind investing and trading?
Can you carry out these activities systematically, in a logical manner?
Can you invest and trade based on sound principles?

You bet, you can!

Of course, you can also trade on the basis of news, gut feel, whims, some research report in the newspapers, tips from friends, rumour, etc, or a combination of the above. In my opinion, this mostly leads to grief and lost money over longer periods. I am sure that anyone who has had some experience in the stock markets would have fallen prey to one or more of the above sometime in the past.

So if there are sound principles that one can follow, what are these principles exactly?

Starting with this post, I propose to discuss these principles over a series of posts. The purpose is to highlight the process of establishing a framework for making decisions under uncertainty. Hopefully, it will establish a method to trade logically.

But as we all know, there is a difference between knowing the path and walking the path.

Perhaps this is why business school professors are not good businessmen, or why few doctors are in good shape physically, or why new year resolutions often remain grounded. We all know that if we seek good health, we must control what we eat and drink, exercise and remain physically active, and minimise tension and stress. Knowing is easy, it is the doing part that is so difficult.

Successful investing, like any other activity, comprises (1) knowing exactly what to do and (2) doing what you need to do, time after time. A good process needs to be correctly implemented.

The second point is responsible for 99% of trading success.

This is no exaggeration. People think that if they get a good method to invest, the money taps will automatically be opened for them. They think that if they know when and what to buy and sell, stock market riches are within their grasp. Nothing can be further from the truth.

Successful implementation is largely predicated on proper investor psychology. But psychological talk is something most novice investors and traders tend to dismiss as unimportant. Lest readers of this blog are also put off by psychological issues at the outset itself, I propose to cover the method first and discuss psychology later. Bear in mind however that methods are nowhere as important as personal psychology. At some stage, every trader realises this and internalises it. The less successful ones keep searching for methods.

Two points before we begin. Both would undoubtedly be known to all readers, yet deserve a mention.

First, like everything in life, outcomes in the markets are always uncertain, perhaps more uncertain than real life outcomes. Hence the first thing an investor or trader should focus upon is thinking in terms of probabilities and not in terms of certainty. There is no sure thing in the markets. Yes, we all want our investments to go up and most investors are focused on the profit side of the investment. But investments do go wrong and it is important for investors to think also about the possibility of things not going their way. This needs to be done not only on an intellectual plane, but at an emotional level as well. This is a concept that every investor needs to embrace, not just give it lip service.

Secondly, trading or investing, is a profession like any other. Success in this field requires the same commitment, perseverance and practice that any other profession requires. Unless you are a genius, a whole lot of effort is required to do well in trading. People should not live under the wrong assumption that their sporadic forays into the stock markets will fetch them longer term success. If you are serious about making money in the markets, you need to be serious about your effort in trying to do so. I can almost guarantee you that you are NOT going to become an investing genius merely by studying and understanding investing principles and the process. It takes much more than that.

But we all know the above two points, I only wanted to reiterate them.

So where do we start?

We start off in my next post. So keep an eye on this space...

Friday, October 31, 2008

Biased studies on market timing

On occasions we come across some articles that oppose the idea of market timing. To further their arguments, they show how longer term performance would get hampered if investors miss out on participating in 10/20/50 (or any other number) biggest up days in the markets. So, the studies claim that market timing is futile and not effective at all.

These studies seem to be one-sided and biased. They assume that market timers (like yours truly) will miss out on the up days while still stay exposed to all down days. Of course, with such an assumption, it can be 'proven' that market timing does not work and investors should refrain from making any attempt at timing the market.

Let us examine the truth based on hard data. Note that missing out on up days decreases your returns and avoiding down days increases your returns.

Let us examine the daily returns on the S&P CNX Nifty 50 since 1990.

If you had invested Rs. 100 in the Nifty on 3 July 1990, that would have grown to Rs. 966 as of 29th Oct 2008. This translates into an annual return of 13.2% compounded.

If you had missed out on the 10 biggest up days in the same Nifty, Rs 100 would have grown to Rs. 374 which translates into a compounded annual return of 7.5%. In contrast, if you had avoided the 10 worst days, Rs. 100 would have grown to Rs. 2661, which translates into a compounded annual return of 19.6%. So you would have given up on Rs. 592 (966-374 = 592) by missing the up days but gained Rs.1695 (2661-966 = 1695) by avoiding the down days.

If you had missed out on the 20 biggest up days in the same Nifty, Rs 100 would have grown to Rs. 192 which translates into a compounded annual return of 3.6%. In contrast, if you had avoided the 20 worst days, Rs. 100 would have grown to Rs. 5354, which translates into a compounded annual return of 24.2%. So you would have given up on Rs. 774 by missing the up days but gained Rs.4388 by avoiding the down days.

If you had missed out on the 50 biggest up days in the same Nifty, Rs 100 would have fallen to Rs. 40 which translates into a compounded annual return of (-4.9%). In contrast, if you had avoided the 50 worst days, Rs. 100 would have grown to a whopping Rs. 27678, which translates into a compounded annual return of 35.9%. So you would have given up on Rs. 926 by missing the up days but gained Rs. 26712 by avoiding the down days.

This data shows that successful attempts to avoid the worst down days would not only reduce risk (by decreasing the chance of a large decline) but gain much more than might be lost by missing some or even all of the biggest up days.


Moreover, there is no evidence in this that shows that trying to avoid the biggest down moves will result in missing the biggest up moves. Why should people think that market timers will be wrong all the time?

It is observed that most of the big up days up or down days occur in the midst of major trends. Such large trends are not too difficult to identify with simple market timing tools. These tools are not precise but are by and large effective. Market timers do not have to sell at the precise top or buy at the exact bottom. Market timers can exit in a downtrend identified ahead of major declines (like the current one). Such exits are likely to enhance returns very significantly. The same is true of entries. Market timers only need to identify that an uptrend is underway, and in most cases the big up days will follow.

Market participants, investors and speculators alike, should try to time the markets. This means 2 things:
1. Exit as quickly when a downtrend develops. This can be done via hedging a portfolio or selling out of positions. Once markets start going down, either sell out or use options/futures to protect your portfolio.
2. Enter the markets after an uptrend develops. Wait for the markets to tell you that an uptrend has developed and buy thereafter. This means not buying into a falling market even as stocks get cheaper and cheaper.

How to execute this is a different topic. However, in principle, this is one way of timing the markets and attempting to achieve superior returns.

Sunday, July 13, 2008

The hype, the party and the hangover

It is not easy to resist falling prey to hype.

Over the last 4-5 years, India became a much hyped country.
Tailwinds were strong.
Interest rates were low.
Inflation was benign.
Domestic capacity was adequate to meet rising demand.
Riding on such benign conditions, India recorded 4-5 years of high growth.
The economy boomed.
Incomes started rising.
Corporate profits rocketed.
Asset prices rose; stocks rose, real estate rose.
Every investor became a genius.

Lets party, said the people.
So the party began.
People danced to the music.
Drinks flowed like water.
Everyone was happy and cheerful.

And also drunk.

India had arrived, the experts claimed.
We will become an economic superpower, they asserted.

No one can afford to ignore us, they said.
We thought we had become a asset class in ourselves.
Foreigners threw money at our stocks and stock valuations went higher.

Lets party more, we said to ourselves.

And we did party harder.
And got high on our own success.
Till one fine day.
The DJ stopped the music.
No more drinks, said the bartender.

The party came to an abrupt end.

A few wise men had already left the party.
A few others took the cues and started leaving too.
The rest stayed on and protested.
We want the party to continue, they exclaimed.
We demand more music and more drinks, they said.
But all the huffing and puffing could not start the party again.

Some said that the party would start soon.
Others advised people to wait for a 'longer' period.
But the party simply would not resume.
And the effect of the liberal drinking and wild dancing started showing up.
Those who chose to stay had a severe bout of hangover from the drinking.
And sore muscles from the excess dancing.
It will take time for the hangover to go away.
It will take time for the untoned muscles to recover again.
Till that time there will be pain and misery.

We fell prey to hype.
Some had shouted BRIC.
Some had shouted Great Growth Story.
Some had shouted decoupling.
Some had shouted domestic consumption.

And we believed every word of it.
All of the above is true to some extent.
But not to the extent the consensus thought.
Potential exists, that woud make investors money.
Hype simply leads to ruined plans and shattered dreams.

Every upswing sows the seeds of its own demise.
And a downswing follows as upswing.
India would continue to grow.
But not at 10% per annum.
Beneficial external conditions and excess capacities lulled us into believing that 9% growth was a given.

And that investing was the easiest game around.
That investing did not require any skill, experience or hard work.

When external conditions start acting like headwinds, they put the brakes on growth.
Inherently, we do not have the ability to grow at such high rates for ever.
Not enough infrastructure, not enough political ability, not enough maturity among ourselves.
So not enough returns from stocks.

We should have avoided hype when there was such.
We should continue to avoid it.

But things are not gloomy at all.
Foreign money drives our stock markets.
Foreign money will come back again.
History suggests it behaves exactly the same way time after time.
Foreign money is not neccessarily smart money.
It will come again.
India will become hype again.
Spring follows Winter.

Be ready for Spring.
Be ready with your money.
Be ready to ride the hype again.
But dont fall prey to it at the end.
You can again make a lot of money.

Friday, July 4, 2008

Why? Wrong causation

"The markets crashed on rising crude oil prices."

"Banking, Realty stocks hit on high inflation data."

"Markets bounce back on the back of prospects that the UPA government will survive its full term".

You would have heard or read such comments quite frequently on business channels and in newspapers. The media tries to explain every market move. It tries to find reasons for changes in price. So if stocks go down and crude oil prices also have also risen, they simply put together a causation: Rise in crude prices caused stock prices to fall.

(These days there is a popular view that stock are falling primarily because crude oil prices are so high. Absent the rise and stocks would rise, is the implicit logic. I think this is just an excuse.)

I have often noticed how this explanation is far removed from what happens on floor of the stock markets. Sometime ago, on a particular friday, inflation figures came our slightly higher than expectations, but not too divergent from the expected figure. The markets promptly went up with the Nifty gaining 20 points. The markets stayed high for a few more hours but eventually collapsed at the end of the day to close in the negative. The newspaper headlines next day screamed how markets were spooked by high inflation.

The truth was that markets actually went up after the news and stayed there for quite some time. Clearly, the inflation figure did not cause markets to fall. What caused them to collapse? - we don't know for sure. All we know is that the prices went up when inflation figures were released and they went down at the end of the trading day.

According to the media, a $2 rise in crude oil prices caused stock markets to go down on a particular day. However, on another day, a $5 rise in crude oil prices saw the stock markets going up without any other positive news. So why did a greater rise in oil prices not cause markets to go down with even greater force? We don't know!

Media will keep searching for reasons behind price movements. It simply draws cause and effect relationships with an external event and market moves. However this might just be a convinient excuse to explain market phenomenon. As we have seen, the same external event causes diametrically opposite moves in the markets, across time. Sometimes markets fall after bad news. Sometimes markets rise after receiving the same bad news. The fact is that we really do not know why markets move on any given day. The only thing we can say is that if selling is greater than buying, prices fall. If buying is more than selling, prices rise. That is the most obvious thing there is, but in reality that is all that we know about price movements.

So the headlines should be like:

"Markets went down as selling exceeded buying. Reasons unknown!"

I doubt we would ever see such a headline. For us, what matters however is whether prices are up or down. True reasons perhaps we shall never know...and don't even need to know.

Wednesday, July 2, 2008

Why losses should be kept small - A mathematical view


"Cut your losses short and let your profits run."


I keep repeating this cliche ad nauseum. Seasoned traders swear by it. Amateurs flout it (to their own detriment). I believe it is key to investment success. Intuitively we might agree that it is important, but can we really prove it's worth?


Investors seek returns from their investments and trading decisions. Amateur investors like to make money on every trade/investment. While we might want our investments to be winners, there are too many imponderables that could put a spanner in their wheels. Ergo, we can land up with losses as well (whether or not we book them). In the markets all outcomes are uncertain. Profits and losses, both, are part of the trading landscape. (In fact, successful speculators lose more often than they win)


Since every outcome is uncertain, winning merely has probability, as has losing. So over time, we would have some winning investments and some losing investments. Lets consider the following:

W = Probability of Winning (0<=W<=1)

L = Probability of Losing (0<=L<=1, L=1-W assuming no breakeven trade)

AP = Average size of profits (AP>0)

AL = Average size of losses (AL<0)


This brings us the what is termed as the Mathematical Expectation (E) of our investing decisions. E is the Expected Profit per trade.


E = W*AP + L*AL


(Note that the product L*AL is negative since AL has a negative value.)


E denotes what profit we will make on an average per trade. All other things being equal, the larger the value of E, the better it is for our returns. Traders should strive to achieve a high value for E from their trades.


Look at the right hand side of the above equation. For E to be high, the first part (W*AP) of the sum needs to be high while the second part (L*AL) needs to be kept to a small (negative) value.


For W*AP to be high, either W needs to be high or AP needs to be high or both.

But W has an upper limit and cannot get higher than 1. (1 implies all winning investments)

AP in contrast does not have any upper bound. Though profits don't go to the moon, large profits are not uncommon.

Just to illustrate, say,

AP = 4% and W = 0.8 (80% chance of success), W*AP = 3.2%

AP = 8% and W = 0.6 (60% chance of success), W*AP = 4.8%

AP = 16% and W = 0.4 (40% chance of success), W*AP = 6.4%

AP = 50% and W = 0.2 (20% chance of success), W*AP = 25%


Your profits go up even as your winning percentage goes down. It is easier to find investments with a lower success rate. Most people want to maximise the chance of winning. Professionals focus on maximising profit instead, not the chance of winning. If risk is properly managed (which it should be), it is much easier to find trades that have a lower chance of making money than ones that have 80%, 90% or higher chance of success.


In the product, W*AP, it is AP that plays a much dominant role compared to W in determining the product. Average Profit is more important than the Winning Percentage. Try seeking a high value for average profits - LET YOUR PROFITS RUN


Using the same logic, on the other part of the equation, L*AL, average losses are more important than chance of loss. For example,

L= 2% and L= 0.6 (40% chance of success), L*AL= 1.2%

L= 5% and L= 0.5 (50% chance of success), L*AL= 2.5%

L= 10% and L= 0.4 (60% chance of success), L*AL= 4%

L= 20% and L= 0.3 (70% chance of success), L*AL= 6%


The chance of success is increasing, but your losses are also going up.

An 5 fold increase in average loss needs to be compensated by a 80% decrease in your losing percentage. If average loss increases from 2% to 10%, your winning percentage (initial value = 50% = chance of heads on a coin flip) needs to increase to 90%, not an easy task. It is much easier to keep a loss down to 2% and get a 50% success rate than to let losses increase to 10% in an attempt to get a 90% success rate.

The bottomline is: Keep average losses small - CUT LOSSES SHORT


Let profits run and cut your losses short! When you have a profit, don't sell under the fear that the markets would take away your profits. Let profits become big. When you have a loss, don't hope that it would turn around. Don't let losses get big.

It does not matter whether you win or lose. What matters is how much money you make when you win and how much money you lose when you don't win.