In an unprecedented move, activist investor Bill Ackman’s hedge fund Pershing Square Capital Management offloaded its entire stake of 9.8 million shares in Canadian Pacific Railway Limited (TSX:CP)(NYSE:CP) on August 3, valued at about $1.9 billion.

Interestingly, Canadian Pacific has been among Ackman’s most successful investments; the stock has almost quadrupled since 2011 when Ackman first bought the stock. So what could have compelled Ackman to exit his entire stake in a company that made a remarkable turnaround thanks to his investor activism?

Ackman smartly sold at the top

Ackman’s interest in Canadian Pacific showed signs of waning when he sold a large tranche in April. The stock’s decline since the middle of last year didn’t go down well with Ackman–Canadian Pacific lost 10% between July 2015 and April 2016 at a time when peer Canadian National Railway Company (TSX:CNR)(NYSE:CNI) stock had rallied almost 7%.

Ackman was perhaps waiting for a slight recovery to offload his remaining stake. If you look at Canadian Pacific’s price chart, it doesn’t take too long to realize that Ackman sold his stake around the only two peaks the stock has formed so far this year.

CP Chart

CP data by YCharts

Why Ackman exited Canadian Pacific

Ackman’s latest move comes at a time when low oil and commodity prices have hit shipments at railroads. In its second quarter Canadian Pacific reported 12% and 16% declines in revenue and net income, respectively. Crude, coal, grain, and potash were some of the worst-hit segments.

The most disappointing number, however, was Canadian Pacific’s operating ratio–a key metric that gauges efficiency at railroads and should be low–which increased a percentage point to 62% in Q2. Comparatively, Canadian National reported a record-low quarterly operating ratio of 54.5% for its second quarter.

Those numbers may have worried Ackman, raising concerns about a slowdown in the railroad industry and the potential upside in Canadian Pacific stock after its massive run-up in the past five years. Ironically, Canadian Pacific is also trading at a premium to the better-performing and higher-dividend-paying Canadian National based on almost every key metric, be it trailing P/E, PEG ratio, or price-to-book ratio.

Canadian Pacific faced a major setback earlier in the year when it had to drop its US$30 billion bid to acquire Norfolk Southern–a move that Ackman was backing. With no alternative growth plan in sight, end markets looking weak, and Canadian Pacific having already found a footing in the industry without much scope for investor activism, Ackman had quite a few reasons to exit.

What’s more, Canadian Pacific’s CEO Hunter Harrison, who came to the helm thanks entirely to Ackman’s activism, is also set to retire in a year’s time.

Why you shouldn’t follow Ackman

I wouldn’t encourage investors to follow suit if they have a longer-term perspective. Canadian Pacific proved its mettle under Harrison’s leadership, more than doubling its net profits and improving its operating ratio dramatically since 2012.

Even now things don’t look as sombre when you consider the company’s plans to add jobs in coming months to push revenue if the Canadian grain crop hits record volumes. In fact, Canadian Pacific is even optimistic about hitting double-digit growth in earnings per share this year at sub-60% operating ratio. Combine that with the company’s recent dividend increase of 40%, and you can safely vouch for management’s focus on increasing shareholder value.

Selling the stock at such a time simply doesn’t make sense.

NEW! This Stock Could Be Like Buying Amazon In 1997

For only the 5th time in over 14 years, Motley Fool co-founder David Gardner just issued a Buy Recommendation on this recent Canadian IPO.

Stock Advisor Canada’s Chief Investment Adviser, Iain Butler, also recommended this company back in March – and it’s already up a whopping 57%!

Enter your email address below to claim your copy of this brand new report, “Breakthrough IPO Receives Rare Endorsement.”

Fool contributor Neha Chamaria has no position in any stocks mentioned. David Gardner owns shares of Canadian National Railway. The Motley Fool owns shares of Canadian National Railway. Canadian National Railway is a recommendation of Stock Advisor Canada.