Source Code Handover Checklist: Taking Over a Trading Bot
Taking over a trading system from a previous developer is complete only when someone who has never seen the code can rebuild it from what you received, run it on test data and reproduce a known result. Before the final payment or the developer’s last day, ask for six things: the repository with its full version history, build instructions that work on a clean machine, a list of dependencies with versions and licenses, an inventory of every credential the system uses, documentation, and test data with reference results. Then rotate every credential the previous developer knew. This checklist applies to Python systems for Interactive Brokers as well as MQL5 Expert Advisors for MetaTrader 5, and it includes a short, careful note on who owns the code, which depends on the contract and the country.
Note: This article describes the legal situation in general terms as of the date below. It is not legal or tax advice and does not replace a review of your specific case by a lawyer or tax advisor. All information without guarantee of completeness or timeliness.
What does a complete source code handover include?
The goal of a handover is independence: afterwards, you or another developer can build, run, change and redeploy the system without the person who wrote it. That is a stricter test than “the code is in a shared folder”. A trading system also carries state that the code does not show: which version runs live, which settings it uses, which accounts and keys it touches. The table lists what to ask for and how to check that it is really there.
| Item | What to ask for | How to check it |
|---|---|---|
| Source and history | Repository with all branches, tags and commits | Clone it and identify the commit that runs live |
| Build and run | Written steps, exact tool and dependency versions | Rebuild on a clean machine using only the notes |
| Dependencies and licenses | Libraries, indicators and paid components with version, source and license | Compare with the imports and include statements in the code |
| Credentials | Inventory: what each one unlocks, where it is stored, who knows it | Scan code and history, then rotate |
| Documentation | Architecture, configuration reference, operations runbook, known issues | Walk through it together with the developer |
| Test data and reference results | Data snapshot, tests, a documented backtest or paper session | Reproduce the result after the rebuild |
| Live state | Server or VPS setup, scheduler, the settings in use | Compare with the running system |
Agree on this list in writing before the last invoice is paid; a developer who is moving on may not have time to reconstruct missing pieces later. When I audit a takeover, the rebuild on a clean machine comes first, because it exposes missing files, undocumented steps and unpinned versions in one go.
Version history: ask for the repository, not a zip file
The current files show what the system does. The history shows why: which change introduced a behavior, which version was live on a given day, which experiments were abandoned. Without history, you cannot bisect a bug or tell an intentional rule from an accident.
If the developer used Git, the simplest complete handover is a bundle. According to the Git documentation, git bundle create with --all includes all refs, so every branch and tag together with the commits behind them, in one file that can be cloned like a repository. The same documentation lists what a bundle leaves out: the index, the working tree, the stash, per-repository configuration and hooks. Ask for hooks, CI settings and local configuration separately. The commands below were tested with Git 2.54 on a sample repository:
# Previous developer, inside the repository: every branch, tag and commit in one file git bundle create handover.bundle --all # You: clone it, verify it, check that all branches and release tags arrived git clone handover.bundle trading-system cd trading-system git bundle verify ../handover.bundle git branch -a git tag # First look for credentials in every commit, including files deleted later git rev-list --all | xargs git grep -n -I -i -E "api[_-]?key|secret|passw|token"
Then pin down the live version: the tag or commit that runs in production and the files actually deployed on the server. For an MQL5 Expert Advisor, insist on the .mq5 source, every .mqh include file and the source of each custom indicator it loads, not only the compiled .ex5. Compile the received source yourself and run it and the deployed version through the Strategy Tester with identical settings; the trade lists should match. If the developer never used version control, ask for every dated version they kept, create a repository on the day of the handover and commit exactly what you received, so that every later change is traceable.
Does it build and run? The clean-machine test
Rebuild the system on a machine or container that has never seen it, using nothing but the written instructions. Every step you have to guess is a gap in the documentation, and every “works on my machine” is a missing dependency. For a Python system, that means the interpreter version, exact package versions (a lock file or pinned requirements), operating system packages, environment variables and the version of TWS or IB Gateway it was tested with. For an Expert Advisor, it means a build in MetaEditor without errors, with all include files and indicators in place, and a note on any remaining warnings.
Building is not yet running. Ask for test data and a reference result: the data snapshot behind a documented backtest, with source, period, costs and settings, or the log of a recorded paper session. After the rebuild, the same inputs should produce the same output, or the difference should be explainable. Typical example: a rebuilt Python bot produces slightly different trades because an unpinned library changed a default; pinning the version restores the reference result and turns a silent drift into a documented decision.
The documentation you need is short but specific:
- Architecture: components, data flow and which process sends orders.
- Configuration reference: every parameter with unit, default and allowed range.
- Runbook: start, stop, restart with open positions, routine tasks and what to do when an alert fires.
- Known issues: workarounds, unfinished features and broker-specific quirks.
- Deployment: server, scheduler, monitoring and where the logs go.
Existing unit tests belong in the handover too. If there are none, the reference result is the minimum test you need before changing anything.
Dependencies and licenses: what may you use and pass on?
List every component the system needs: libraries, broker API packages, include files, custom indicators, data feeds and paid tools, each with version, source and license. Then compare the list with the imports and include statements in the code. Anything the code uses that the list misses is a finding, and so is code copied from elsewhere without a recorded license.
Licenses matter as soon as the system might leave your hands. Copyleft licenses such as the GPL attach conditions to distribution. According to the GNU GPL FAQ, you may modify GPL software and use it privately without releasing your changes, and making copies within one organization is not distribution. Transferring copies to other organizations or individuals is, and so is providing copies to contractors for use off-site. If you plan to sell the system, license it to others or hand it to a partner, have the license list checked first.
Purchased components are a separate trap. According to the MetaTrader 5 help, a product bought in the MQL5 Market is bound to the computer on which it was activated, runs only if the platform is authorized with the MQL5 account used for the purchase, and has a limited number of activations, which are not reset or restored when the product is removed. If the previous developer bought an indicator that the Expert Advisor loads, the purchase belongs to their account; you need your own purchase or a replacement. The same question applies to commercial libraries and data subscriptions that were licensed to the previous developer.
Credentials in the code: find them, then rotate them
Trading systems touch valuable accounts: the broker account, market data, the server, alerting channels, cloud storage and sometimes the MQL5 account behind a purchased indicator. Credentials end up in configuration files, scripts, notebooks, Docker files, CI settings and old commits. A key deleted in the latest version is still in the history, which is what the git grep above checks. A dedicated scanner finds far more patterns: according to its README, Gitleaks scans a local repository’s history by reading the commit patches from git log -p.
Build an inventory with one line per credential: what it unlocks, where it is stored, who knows it and how it is rotated. Then rotate everything the previous developer knew, including credentials that never appeared in the code. GitHub’s documentation is clear on the order: revoke or rotate a leaked secret first. Rewriting the history afterwards may not even be warranted, and it cannot remove the data from other people’s clones; forks, cached views and pull requests can keep old commits reachable. If you do rewrite it, GitHub recommends git-filter-repo, plus push protection against new leaks.
- Create the new credential and store it outside the code, for example in environment variables or a secret store.
- Deploy and test it, preferably outside trading hours, and confirm that the system connects and runs as before.
- Revoke the old credential and remove the previous developer’s users and permissions at the broker, the server and the hosting provider.
- Record the date and who holds the new credential.
Who owns the code after a handover?
The following is a general overview. Ownership of software depends on the contract, on whether the developer was an employee or a contractor, and on the country; paying for the work does not by itself transfer it.
- United States: copyright vests initially in the author (17 U.S.C. § 201(a)). In a work made for hire, the employer or commissioning party is considered the author and owns the copyright unless both sides have agreed otherwise in a signed written instrument (§ 201(b)). According to the US Copyright Office, that covers work an employee creates within the scope of employment; commissioned work qualifies only if it falls into one of nine listed categories and both parties sign a written agreement saying so, and software is not named among the categories. Otherwise, a transfer of ownership, other than by operation of law, requires a writing signed by the owner (§ 204(a)).
- Germany: copyright itself cannot be transferred, except by inheritance (section 29 of the Copyright Act). The author grants rights of use, and where the contract does not specifically designate the types of use, the purpose envisaged by both parties decides (section 31(5)). The special rules for computer programs in sections 69a ff. add two points. For a program that an employee creates in the execution of their duties or following the employer’s instructions, the employer alone is entitled to exercise all economic rights unless otherwise agreed (section 69b). And unless special contractual provisions say otherwise, a person authorized to use a copy may reproduce and adapt the program where this is necessary for its intended use, including the correction of errors (section 69d).
- Other countries have their own rules, and contracts often choose the governing law.
In practice, have the rights to the code confirmed in writing, including modification, distribution and the third-party components, and have the document reviewed by a lawyer in your jurisdiction before the final payment and before you sell or share the system. Which clauses belong in such an agreement is covered in the guide on hiring an Interactive Brokers API developer.
Limits and risks of a handover check
A complete handover makes a system maintainable; it does not make it correct or profitable. A rebuild that reproduces the reference backtest only proves that you have the same code and data, not that the backtest was realistic. Costs, slippage assumptions, the out-of-sample period and the number of variants tested need their own review, and the system should stay on a paper or demo account until the new owner has seen it handle restarts, rejected orders and disconnects.
- Hidden live state: open positions, pending orders and persisted counters at the moment of handover must match what the code expects after a restart.
- Undocumented operations: weekly logins, manual restarts or broker-specific workarounds that only the previous developer knew.
- Lock-out: rotating a credential that the live system still uses can stop it mid-session, so plan the order of the steps.
- Legal uncertainty: unclear rights or licenses can block a later sale, even when the code works.
Trading securities, futures, forex or crypto assets involves a substantial risk of loss up to total loss. A change of ownership is a good moment to verify that the risk limits and the kill switch work as documented.
What to do before and after the handover
- Agree on the handover list in writing, with a date, before the final payment.
- Receive the repository as a bundle or another complete copy and verify that all branches and tags arrived.
- Identify the version that runs live and freeze changes until the handover is complete.
- Rebuild on a clean machine and reproduce the reference result from the test data.
- Compare the dependency list with the code and clarify every license, including purchased indicators.
- Scan code and history for credentials, then rotate all credentials the previous developer knew.
- Walk through the runbook with the developer while they are still available; take notes or, with their consent, record the session, and collect answers to open questions in writing.
- Have the rights to the code confirmed in writing and reviewed by a lawyer.
Whether the system you received is worth keeping is a separate question, covered in how to evaluate an existing EA or trading bot. If you want an independent check, a takeover audit of the trading system covers completeness, history, build, dependencies, licenses, credentials and documentation and ends with a list of what is missing or must be replaced.
Frequently asked questions
What should a source code handover checklist include?
At minimum: the repository with its full version history, build instructions that work on a clean machine, a list of dependencies with versions and licenses, an inventory of all credentials, documentation of architecture, configuration and operations, and test data with a reference result. For a trading system, add the version and settings that run live and the procedure for restarting with open positions.
How do you take over code from a previous developer?
Agree in writing on what will be delivered, then receive the repository with its history, rebuild it on a clean machine from the written instructions and reproduce a known result. Walk through the documentation with the developer while they are still available. Finally, rotate every credential they knew and have the rights to the code confirmed in writing.
Who owns code that an employee wrote for a trading system?
In the US, a work an employee prepares within the scope of employment is a work made for hire: the employer is considered its author and owns the copyright unless both sides agreed otherwise in a signed writing. In Germany, the employer alone may exercise all economic rights in a program that an employee created in the execution of their duties or following the employer’s instructions, unless otherwise agreed. Code from contractors follows other rules; have unclear cases checked by a lawyer.
Do I need to change passwords and API keys after a developer leaves?
Yes. Treat every credential the previous developer could see as exposed, whether or not it appears in the code: broker passwords and API keys, server access, data subscriptions, alerting and cloud accounts. Create the new credential, deploy and test it, then revoke the old one. GitHub’s documentation recommends revoking or rotating a leaked secret before any cleanup of the history.
Is the compiled EX5 file enough to take over an Expert Advisor?
No. The .ex5 file is the compiled program. To fix bugs or adapt the EA, you need the .mq5 source, every .mqh include file and the source of each custom indicator it loads. Compile the received source yourself and compare its behavior with the deployed version in the Strategy Tester, using identical settings, before you rely on it.
Sources and status
- git-bundle: Move objects and refs by archive — Git documentation (git-scm.com) (retrieved November 19, 2026)
- Removing sensitive data from a repository — GitHub Docs (retrieved November 19, 2026)
- Gitleaks README (scanning git history with git log -p) — gitleaks on GitHub (retrieved November 19, 2026)
- Frequently Asked Questions about the GNU Licenses — Free Software Foundation (retrieved November 19, 2026)
- How to Purchase an App (activations of MQL5 Market products) — MetaTrader 5 Help (MetaQuotes) (retrieved November 19, 2026)
- Circular 30: Works Made for Hire (revised August 2024) — U.S. Copyright Office (retrieved November 19, 2026)
- Copyright Law of the United States, Chapter 2 (17 U.S.C. §§ 201 and 204) — U.S. Copyright Office (retrieved November 19, 2026)
- Copyright Act (Urheberrechtsgesetz), English translation, sections 29, 31, 69a, 69b and 69d — Federal Ministry of Justice (gesetze-im-internet.de) (retrieved November 19, 2026)
As of November 2026. Third-party rules, prices and APIs may have changed since; the providers' current documentation and the official texts are authoritative.
This article is also available in German: Quellcode vom bisherigen Entwickler übernehmen: die Checkliste.
Taking over a trading system and want to know what is missing? Get in touch — a free intro call clarifies the scope of a takeover audit: history, build, dependencies, licenses, credentials and documentation. More: Trading system code review and audit.