recursive has hit the nail on the head when it comes to your time expense (don't forget to account for the opportunity cost here). Programming is a craft. As with any other craft (carpentry, plumbing), you will take a solid few years to get reasonably good at it. This is assuming you get into a good place where you can be an apprentice who has good teachers to learn from. If that's not the case, then you will have to give yourself even more time to become good, let's say six years. Now you are past 40, and are looking at recruiters who are (a) looking to lowball you and (b) expecting you to have a great deal of expertise, both at the same time. Assuming this doesn't completely demoralize you, you are still only at a mid-junior level after all this effort, not to mention the loss of income and career opportunities in banking.
Banking pays well. If you need the income, you are better off sticking to it, because the pay differential and loss of opportunity cost just don't justify getting into this industry.