Unless the contract stated specifically that the coder retains ownership of the code, He was your employee, the employer does.
The idea was yours and he should not make use of it outside of your code.
Handle it as a thief.
It's by no means a simple question, and nobody on this forum is a lawyer. But, unless you specifically agreed in advance that you were paying for the source code as well as the working product, a judge in any G8 country would be likely to rule that you haven't paid for ownership of the code. The distinction between the "idea" and the code which implements that idea merely complicates things further.
You won't find a definitive answer on the internet, because lawyers like to charge fees, but you're not going to like quasi-legal opinions such as the following: http://programmers.stackexchange.com/questions/160503/does-custom-created-code-for-a-client-imply-copyright-ownership
Yes. Next time you better said the pay include with the source code. Basically the coder have done his part and get paid for it (compiled ex4).
Idea and coding is treated for 2 different things.
This will depend on both the terms of your contract with the coder, and the applicable legal jurisdiction that covers the contract.
If you simply contracted a coder to create you an expert that does 1-2-3... and the coder has provided you with an expert that does 1-2-3... then most people would consider the contract to have been settled.
If this is the case, you would need to argue that there was an implicit understanding that you would receive the source code. This will be far harder to do than if you expressly requested it.
The coder is not your employee.
By not giving you the source, he hasn't necessarily done anything with your idea. He simply isn't giving you something you didn't contract for.
Sorry if this isn't what you want to hear.
Do not assume a freelance coder is your employee, under the law he almost certainly is not.
The bottom line is this, when the coder retains the source code and claims he owns the copyright, only a court of law can order him to give you that source code. If you had no carefully worded agreement that clearly states the copyright and the source code belong to you, suing him could turn out to be an expensive foray into the quagmire of copyright law.
Programmers don't get it all their own way though, if the coder retains copyright it means he is licensing the trader to use his software, this leaves the coder open to liability claims. So in other words if the EA does not work as agreed and you lose money because of it, you could sue him for your losses. He might change his mind about claiming the code when you explain that part to him.
Programmers should be careful about this, open source developers are well aware of how it can backfire on them and they have very specific licensing to cover them. To code for other people and protect yourself from repercussions while protecting your work you almost need to be a lawyer too.
In my opinion the best thing to do as a coder is agree the job is to write source code for the other party, they own it and the copyright to it, therefore absolving the coder of all liability.
The MQL5 jobs section should have all that covered but still read the small print before you agree a job even on there.
Further to what I mentioned in the previous post I was talking to a lawyer buddy of mine, he explained to me, if you code EA for someone and charge them for the executable while retaining ownership of the code, there is a very good chance if they lose their money on that EA they could sue you for their losses regardless of whether the EA worked properly or not.
The reason is, they are not the owner of the project you are, regardless of their input. You then sold them a program which lost them 20 grand.