MetaTrader 5 (MT5) is the most recent release of the trading platform by MetaQuotes. MT5 was released in 2010 but is not backward compatible with MetaTrader 4 (MT4) which was released 5 years earlier on the 1st July 2005.
MetaTrader 5 operates a first in first out (FIFO) order management system.
What does FIFO actually mean?...
Say the trader opens a 1 lot long (buy) position in EURUSD and then a few hours later they take some profit as the market has gone up. If they sell half of their original position (0.5 Lots) the trade management system in MT5 calculates the total exposure to EURUSD and effectively closes half of the original 1 lot long position resulting in a net or aggregate remaining postion of 0.5 lots long.
In MT4 a trader can open as many long (buy) or short (sell) positions as they want for the same asset. So you could have several long and short positions in EURUSD at the same time. If the trader has 2 lots of long positions and 2 lots of short positions the overall market exposure is zero because the long lots are the same as the short lots - effectively making the trader's position fully hedged. This means the effective profit and loss for the position will remain static on an intraday basis. It may change overnight due to interest payments though. You would of course need to factor in spread and/or commission charges when you trade in both directions simultaneously.
So in MT4 a trader can control their market exposure using hedging whereas in MT5 the trade management system continuously calculates the aggregate position for whatever is being traded. The FIFO based trade management system has some disadvantages particularly where the trader performing arbitrage. The FIFO position management makes keeping track of individual positions very tricky indeed.
Personally I think the main driver behind the development of MT5 was to maintain the companies reach in the US market which introduced the 'no hedging rule' using the NFA Compliance Rule 2-43b in 2009. This meant that USA based MetaTrader brokers could no longer offer MetaTrader 4 to their US based clients without breaking the NFA compliance ruling. So FIFO based MT5 had to happen in the US market to MetaQuotes to have any presence
The other major difference between MT4 and MT5 is the lack of backward compatability between indicators and expert advisors. Essentially code written for MT4 won't run on MT5 without a fairly substantial bit of work. Same goes for MT5 code - it won't work on MT4 without some development work. MetaQuotes have tried to harmonise the MQL4/MQL5 environments over the years but the lack of forward/backward compatability is still an issue for traders with indicators or expert advisors written for MT4/MT5 who want to interchange between platforms
When MT5 was released I personally couldn't understand why a software company would release a new version of their platform which wouldn't communicate with the existing release in the market - the lack of backward compatability seemed somewhat an 'own goal'. There is quite a lot of hot air about MT5 being able to run a wider asset universe than MT4 but most MT4 brokers allow the trader to access stocks, crypto, indices etc using CFDs or derivatives so I'm not sure the wider asset universe has legs for MT5 fans.
Another 'improvement' with MT5 is the provision of a better backtester which is capable of running multiple assets, The backtester in MT4 is limited to a single asset. The one major area which most people overlook is the data on which the backtester is run. Most historic broker data is 'patchy' or 'holey' ie it has missing data / isn't contiguous. If you take a close look at backtester results and you will often see spikes and large movements in the equity curve and these generally correpsond to missing data in the sample thus creating a spike / outlier. So backtesting on poor or not pre-processed sampkle data will tend to produce ambiguous results.
Also it pays to be very wary of tool vendors who publish equity curves with massive profit factors. It's incredibly easy to write an EA and then optimise it to give amazing returns BASED ON SAMPLE DATA.. so what some 'sketchy' vendors do is curve fit their system performance to fit the market dynamics of the data sample. Essentially people are being duped into thinking a system can turn $1000 into millions of dollars in a few weeks. It just doens't happen in real conditions unfortunately. So be careful with backtester results and fancy equity curves published by people trying to sell you a trading tool!
So which version of MetaTrader is best? The fact every well established broker is still supplying MT4 kind of speaks for itself. New brokers signing up apparently aren't being given the chance to provide an MT4 offering so it appears MetaQuotes want to move people towards MT5. I personally think MT4 and MT5 will co-exist for a long time. So the choice is ultimately yours but there's not really much difference unless you're a hedger.