SOME investors are getting nervous as stock markets here and in the US bump around their all-time highs.

Newspaper reports are beginning to speculate that a correction may be around the corner and people are increasingly questioning what this means for their investments.

Small corrections are very hard to foresee and, generally speaking, when they happen they should be welcomed - they provide buying opportunities to add to portfolios at a better price.

But the legendary fund manager Peter Lynch is quoted as saying that “far more money has been lost by investors preparing for corrections, or trying to anticipate corrections, than has been lost in corrections themselves”.

But is it better to stay put and ride out the peaks and troughs or should you try to move into and out of rapidly fluctuating markets?

The answer is somewhere between the two.

Around the time of the 2008 financial crisis we were underweight equities, moving to an overweight position in the sharp recovery of 2009.

We did not, however, completely sell out of stocks in 2008 because while the balance of risks was tilted against them, any number of actions by policymakers could have meant the rally came earlier.

Anyone who has too much cash when the stock market rallies will realise the immense damage that does to their financial ambitions.

For example, based on our analysis of the Wealth Management Association’s (WMA’s) balanced portfolio, and working backwards over the past 20 years, it is clear that staying invested - even around deeply troublesome periods for the market – remains the best tactic over the long term.

Missing only the best five days in the market in the past 20 years would have led to a 23 per cent lower overall return.

Missing the best 10 days, meanwhile, would have reduced returns by a staggering 40 per cent.

Conversely, missing the 20 worst days would have led to double the returns of staying invested all along.

So we are always looking to take decisions that should enhance portfolio returns. Equally, we recognise that it is all but impossible to time the market perfectly, even with the best forecasting skills.

Large corrections, or severe bear markets, are usually associated with US recessions.

How should that be applied in current market conditions?

While recessions are relatively hard to foresee, there are indicators that can be used to forecast roughly when they are likely to occur.

Currently, our analysis suggests that the US is relatively late in its economic cycle, but is still two or three years away from a recession.

Although we expect a mid-cycle slowdown this year, it is likely that there is time to profit ahead of any big downturn.

Indeed, historical analysis shows that some of the best years to invest are just ahead of market highs.

For example, the best year to invest in the past 20 years was 1998, just a year before the FTSE 100 peaked, two years before the infamous tech crash of March 2000, and three years before the deep recession that started in 2001.

During the financial crisis the best year to invest was 2009, when the market bottomed.

That said, it was only marginally better than investing in 2006 and remaining invested, even though this was just a couple of years before the crisis and only a year before the credit crunch began.

Right now, we believe it is better to stay invested while remaining alert to the opportunity to snap up undervalued shares or switch into alternative assets on a selective basis, as and when market conditions permit.

Stephen Martin is head of the Glasgow office at Brewin Dolphin.