Ideally, you should file for a patent at the earliest possible stage in your startup’s evolution because patent protection is somewhat time-sensitive. Obviously you need to make sure that you will qualify for a patent first and then if you do qualify, you will need to build an application that will establish those qualifications. So, if you have the technology and all you need is to write things up and pay a lawyer I would ask you what else you are waiting for.
A patent application is time-sensitive in the sense that the longer you wait, the more you open yourself up to a risk that your patent will be invalid by the time that you do decide to file. For example, if you have the technology and especially if you are using it, and the technology becomes “public knowledge” before you file your application, you will not be awarded a patent because the invention will already be known to the public. It is important to know that this public knowledge standard is pretty low, so it doesn’t take much for an invention to be considered in the “public knowledge.” Actual use of the technology will generally put it in the public knowledge unless there are affirmative acts designed to keep the invention secret.
Also, you are correct to point out the trade secret concern. Generally, one reason to hold off on applying for a patent is to preserve any trade secret concerning the same invention because a patent application will kill any existing trade secret. So, because you have no interest in preserving any trade secret claim, you should apply for a patent as soon as possible.
Like you also were correct to point out, filing for a patent requires writing things up and paying a lawyer. You will need a patent attorney to file your application because the process itself is very technical and time-consuming.