At 63 months, this has become the fourth longest bull market of the past 85 years; it's well past the median, which is 44 months, and it recently surpassed the healthy 1982-1987 and 2002-2007 bull markets, notes Jim Stack, money manager and editor of InvesTech Market Analyst.

Based on historical bull market longevity, however, a final top is almost certain in the next one to two years. As such, this is a good time to look at how sector leadership shapes up in the final year before a bull market peak. It may also be helpful to see how this compares to sector resilience in a bear market.

We looked at the six market tops since 1972 and ranked the sectors by their median gain/loss in the last 12 months of the bull market. We also looked at how often each sector beat the S&P 500 Index (SPX) (batting average).

Energy has typically been the top performing sector with a batting average of 83%, meaning it outperformed the S&P 500 prior to five of the six stock market peaks.

Notably, the Energy sector has returned 10%, or more, in the final year of a bull market in every single instance. That's not surprising in an economy that may be heating up.

Healthcare lands in second place with a median gain of nearly 27%. While this sector outperformed the S&P 500 just half the time, it has had only one negative performance. Meanwhile, it was the top performing sector prior to both the 1973 and 1990 market peaks.

Technology and Industrials also tend to do well in a mature economy, and they frequently occupy leading positions in this ranking.

Sectors that tend to peak early or underperform are equally as important to any late-stage bull market strategy.

Towards the end of an economic recovery, there's usually upward pressure on interest rates, which weighs heavily on the Financial, Telecom, and Utilities sectors. Consumer Discretionary stocks also lose momentum as consumer spending becomes more selective.

The most resilient bear market sectors over the past 42 years have been Energy, Utilities, Consumer Staples, Healthcare, and Telecom. Each has averaged milder losses than the S&P 500 in at least five of the past six bear markets.

In fact, Healthcare has outperformed in all six major market declines. Of these bear market defensive sectors, both Energy and Healthcare are also late stage bull market leaders.

Conversely, cyclical sectors have the worst performance records in a bear market, and some tend to weaken well ahead of the final market top.

Consumer Discretionary, Financials, Industrials, and Technology have all lost more than the S&P 500 in two-thirds of the bear markets since 1972. Financials and Consumer Discretionary are also among the weakest sectors in the year leading up to a bull market peak.

We cannot tell at this point whether this is the final year of the bull market as technical and fundamental evidence remains firm. Yet, it's not too early to start implementing a strategy that reduces portfolio risk and helps us navigate those final months.

In sum, Healthcare and Energy tend to be market leaders both before and after a market peak, so your portfolio should have a heavier weighting in both these sectors.

It's also prudent to reduce allocation in Consumer Discretionary and Financials to less than market weight. These sectors generally lose momentum before the broader index, and they are among the least defensive in a bear market.

The simple adjustments above will help put your portfolio in a more secure position when the market does approach a final peak, yet they will still provide an opportunity for further gains in the interim.

Subscribe to InvesTech Market Analyst here…

More from MoneyShow.com:

Market Cap to GDP: Sign of Caution?

Are Defensive Stocks Really Safe?

Top Timer Eyes Bull-Bear Debate