Every year the pundits re-examine the old stock market adage that investors should sell their shares in May and stay out of the market until St Ledger Day, around the middle of September. It dates back to the seventeenth century when there was an exodus from the City of London for the summer season.

Adrian Lowcock, head of investing at Axa Self Investor, says: "The ‘sell in May’ phenomenon can be traced as far back as 1694. Even though stock markets are meant to be efficient this sort of seasonal behaviour still exists. It is just not significant enough each year to justify investors selling over the summer. "

In 51 years, the market has followed the pattern of rising in the first four months, then falling to September, and then rallying again, on 14 occasions, according to research by AJ Bell the investment platform.

Investors who sold in May would have missed out on double-digit rallies 10 times, most recently in the soaring summers of 2003, 2005 and 2009.

Russ Mould, investment director at AJ Bell, says: "There’s no guarantee that the old pattern will work, plus such trading involves paying stamp duty, traders’ spreads and brokers’ commissions, as well as potentially tax, so frictional dealing costs would start to rack up pretty quickly.

“There is also the danger the investor misses out on valuable dividend payments, whose reinvestment is the real secret to making the most of equities over the very long term.”

But what of the future? Is summer 2016 time for a sell off?

The prospects for the next few months are perhaps best described as uncertain as investors await the results of the EU referendum in late June.

Tom Stevenson, investment director for personal investing at Fidelity International, says: “So far the uncertainty surrounding the outcome of the vote has hit sterling harder than the stock market, but if the Scottish referendum is any guide then volatility could increase significantly as we approach 23 June.”

But rather than pull out of the market, investors could look upon the nervousness as a buying opportunity.

Mr Stevenson says: “Arguably the fear that has accompanied the referendum uncertainty has created some contrarian opportunities in the more cyclical areas of the stock market, such as retailers and housebuilders.” It might therefore be a good idea to keep some cash aside.

Mr Lowcock says: “Investors have already seen one sell-off this year and with the EU referendum vote looming, some are suggesting that we could see a rebound over the summer once these risks are out of the way. But the market will quickly move onto the next issue, whether that is Brexit fallout, China, Greece or Donald Trump. The reality is that the future is always uncertain and it is impossible to predict short term trends with enough accuracy to bet hard-earned savings.”

He adds: “The sell in May adage can be used to your advantage though. Sell-offs in the summer are not uncommon but the timings vary and triggers are often not predicted. Ensure you are well positioned to protect yourself in the event of any sell-off and keep a little cash aside ready to use it to invest at the right time.”

Famous investors such as Warren Buffett always keep money aside ready to take advantage of any such opportunities.”

Remember, too, that the effect of the EU referendum could be short term.

Investors who quit the market could also miss out on any potential rally after the result.

Patrick Connolly, certified financial planner at Chase de Vere, an independent financial adviser, says: “If markets do rally, the danger is that those who have sold in May and are sitting on the sidelines will miss out, or even worse they could jump back in just as the market peaks.”

Perhaps the best advice is to think beyond the summer.

Laith Khalaf, senior analyst at brokers Hargreaves Lansdown, says: “Markets are capricious beasts in the short term and no-one can tell you where the Footsie is going to end this year, but you can have a relatively high degree of confidence that if you invest in the stock market for 10 years or more, you’re going to get a decent return.”

Drip-feeding your money into the markets often makes sense, especially during bouts of uncertainty.

Mr Stevenson says: “By splitting your payments throughout the year, you’ll benefit from a process called pound-cost averaging, which means you end up buying more units when prices are low and fewer when they are high.”

Drip-feeding also takes some of the emotion out of investing, so you aren’t tempted to time the market, which is notoriously difficult.

Mr Stevenson says: “It’s usually more prudent to stay fully invested through market cycles as missing even a handful of the best days in the market can seriously compromise your long-term returns. If there is one stock market adage that investors may want to stick to it is ‘time in the market matters more than timing the market’.”