Around August 2012 I wanted to buy a car and had the same decision as you, sell investments buy cash, or buy finance.
I choose to finance the car instead.
I like working with my personal finance so I monitor my investments on a monthly basis. I also monitor how my decision of financing has turned out.
So I have a excel calculation where I have 2 difference scenario.
One for where I bought cash, I then take the car payment I saved and invest it, for the monthly return on that investment I use the actual return on my investments to arrive at a value of what it would be had I followed that route.
The second scenario is the one I chose, where I have an investment which I didn't sell which I increase monthly with the actual growth on my investment, I then deduct the capital portion remaining on the car loan to arrive at a net value which I then compare with the result from scenario 1.
As at 31/12/2014 my gain from choosing to finance is about 23% of the amount I loaned (21% if I take the capital gain tax liability that I have accrued on the gain). so for me it was a good choice so far.
Things to consider.
Your deposit is not relevant to the scenario as you will have to pay it if you buy cash or finance, so only use the amount you finance.
If the after tax return on your investment is higher than your interest on your loan you will be better off financing.
The past few years the market have delivered returns far in excess of the long term average of 5-6% real return, so about 12% after inflation is taken into account, so looking towards the future the return may not be so great.
Buying cash you get a guarantee after tax return equal to the rate you would have paid, equities is more volatile. (End of Oct my gain from finance dropped to about 6% of the original loan value).
It will also depend on what rate you can get on you car loan, the lower the better it is to invest.
I haven't updated the calc since December because I am oversea for work but I believe it will still be the case that finance benefit me.
So you need to decide what you think the market will do over the next few years and then decide, since what you basically are doing is loaning money (secured by your vehicle) and investing that in stocks, so not everyone may have the risk tolerance for that. I am still in my 20's no wife/kids, so I chose to take the risk and so far it has paid off, however it can turn very quickly.
Going by past years since about 1973 the market seems to crash every 7 years, and it is now 7 years since 2008 so we could be heading into a new crash with all market hitting records high, we could also be years away from the next crash, no one knows.
So understand the risk/rewards of the decision, decide if it fits in your risk tolerance and decide what path you will take.