Interactive Brokers API development: Python bots with ib_async and the TWS API
For Interactive Brokers (IBKR) I develop Python bots with ib_async, the successor of ib_insync, and the TWS API, operated via TWS or IB Gateway. Python is also my tool for backtests, walk-forward analyses, Monte Carlo simulations and AI components.
- Strategy and execution logic: your rules as code, with risk and money management to your specifications.
- Stable operation: logging, fail-safe logic and clean error handling.
- Continuous operation: on a VPS with monitoring, via TWS or IB Gateway, within the limits of Interactive Brokers' login and two-factor rules.
- Acceptance in paper trading: acceptance testing takes place on your paper trading account before the system goes live.
MetaTrader 5 Expert Advisor development in MQL5
As an MQL5 developer, I build Expert Advisors and custom indicators for MetaTrader 5 to your rules.
- Testing: backtests in the MetaTrader 5 Strategy Tester, plus walk-forward analysis and robustness checks.
- Risk rules in the code: position sizing, stops and fail-safe logic as you specify them.
- Live operation: on a VPS with monitoring.
Whether MetaTrader 5 or Python with Interactive Brokers is the better fit depends on the strategy, the instrument and the broker. For a detailed comparison, see the German article MetaTrader 5 oder Python.
TradingView alerts and Pine Script as a starting point
Many strategies start as TradingView alerts or a Pine Script. The rules defined there can serve as the specification for an Expert Advisor in MQL5 or a Python bot for Interactive Brokers, which is then implemented, tested and accepted on your demo account like any other strategy.
If the alerts themselves are supposed to trigger orders, they need a path to the broker: either a bridge service or a webhook receiver of your own that checks every incoming order before it is sent. Whether that fits your setup depends on the broker's interface; I'll go over it with you in the intro call. Background in German: TradingView-Webhooks an den Broker and TradingView mit Interactive Brokers.
ICM Capital (FIX) and the Python research stack
-
ICM Capital · FIX Connection via the FIX protocol.
-
Python stack pandas, NumPy, vectorbt, backtrader, scikit-learn and PyTorch for research, backtests and AI components.
Whether another broker can be connected depends on its interface and is clarified in the intro call.
Backtesting, robustness and AI components
Backtest and robustness
- Backtests with real spreads, slippage and commissions
- Walk-forward analysis instead of curve fitting
- Robustness checks and Monte Carlo simulation
AI and ML components
- Signal models with machine learning
- News and sentiment analysis with large language models (LLMs)
- Regime detection: telling market phases apart
AI is a tool, not a guarantee of profit. Each of these components has to be tested as strictly as a fixed trading rule, because learning models are particularly easy to overfit to historical data. If a test shows that an idea is not robust, you know before real money is involved.
Review of existing bots and Expert Advisors
Already have an Expert Advisor or a bot? I analyze the existing code, look for bugs, weaknesses and risks, improve it in a targeted way and document the changes so they can be traced. This applies regardless of whether the code was written by hand or with an AI assistant such as ChatGPT or Claude. The exact scope is set out in the individual quote after the intro call.
If you develop your own algorithms, coaching is the better fit: code reviews of your EAs, bots and scripts, plus a backtesting methodology that helps you spot the typical sources of error.
Who it's for, and who it's not for
Traders with a rule set or a clear idea
- You trade by fixed rules or have a clear idea.
- You want it tested properly and automated.
- Whether and when the system goes live is your decision.
Prop traders
- You trade through a prop firm and have to follow its rules.
- Requirements such as daily loss limits are built into the system's code.
- You check with the prop firm beforehand whether automated trading is allowed.
Companies and financial service providers
- You are a company or a financial service provider with your own license.
- You need software: execution logic, interfaces such as FIX, a backtesting environment.
- Development to your specification, with AI components if you wish.
Traders who develop their own algorithms
- You program your algorithms yourself.
- You want code reviews and a sound backtesting methodology.
- For that, there is coaching instead of commissioned development.
Not a fit: if you want to buy a ready-made profitable strategy, receive signals or have your money managed. More under What I don't do.
How a project runs: four steps
Analyze and specify the strategy
I work through your idea with you: What can be stated as an unambiguous rule? Where do bias risks arise? Which instrument and platform fit? At the end, the rules are described precisely enough to be coded and tested.
Set up the backtest
A backtest with real spreads, slippage and commissions instead of wishful thinking. Walk-forward analysis instead of curve fitting, plus robustness checks across symbols and market phases and Monte Carlo simulations. You see how stable the results are and where the strategy reaches its limits.
Automate and run acceptance tests on a demo account
Implementation as an Expert Advisor for MetaTrader 5 or as a Python bot for Interactive Brokers or ICM Capital. Risk and money management to your specifications, logging, fail-safe logic and clean error handling are part of it. Acceptance takes place on your demo or paper trading account.
Run it live
The system runs on your side, for example on your VPS, with monitoring. You trigger the live start. If market conditions change, I suggest adjustments and implement them only with your approval.
What you get
- A working system: Expert Advisor or Python bot, installed, tested and accepted on your demo account. You trigger the live start.
- Complete, commented source code: documented, for permanent use for your own purposes. No black box. Your rights are summarized under Source code, rights and acceptance.
- An honest backtest report: with real spreads, slippage and commissions, including drawdown, Sharpe ratio and trade statistics.
- Risk and money management: position sizes, stops and fail-safe logic to your specifications.
- Documentation and onboarding: how the system works, when it intervenes and what needs monitoring, plus a joint walk-through.
- Support: a single point of contact after go-live. I implement changes only after your approval.
Source code, rights and acceptance
What you may do with the software after the project and how the system is handed over is governed by my terms and conditions (in particular § 4 on your cooperation, § 7 on rights of use and § 9 on confidentiality) and your individual quote. In short:
- Source code: you receive the complete, commented source code. No black box.
- Right of use: a non-exclusive right of use, unlimited in time and territory, for your own business or private use. An exclusive right of use can be agreed in the quote.
- Passing it on: you may pass your copy of the program on to a third party as a whole if you give up your own use and render your own copies unusable (§ 69c No. 3 sentence 2 of the German Copyright Act, UrhG). Otherwise, passing it on to third parties and commercial distribution require my consent in text form.
- General building blocks: I may also use general methods, concepts, libraries and frameworks that I develop in the course of the work in other projects. I don't pass your trading rules or other confidential information on to third parties.
- Acceptance: acceptance takes place on your demo account. The acceptance criteria, such as the functions and test cases, are set out in the quote.
- Before going live: you test the delivered software in a test environment before using it with real money. You connect it to your live account and activate it yourself; I don't trade on your account.
- Scope and changes: your quote sets out the exact scope of work. Changes and additions are recorded in text form, for example by email.
This is a general summary of my terms and conditions (German) and not legal advice; the terms and your contract are authoritative.
What I don't do
I build software. I don't manage money, trade on client accounts, sell signals or strategies, promise returns, or give investment, tax or legal advice. Trading decisions and the decision to go live remain yours.
Questions about investments and taxes are best clarified with an investment advisor or a tax advisor.
Trading securities, derivatives, futures, currencies and crypto assets involves substantial risk of loss up to total loss. Backtests and past performance are not a reliable indicator of future results.
What does development cost?
Every project is different: the number and type of rules, the platform, the depth of testing and whether AI components are added determine the effort, so there is no fixed price list. After a free 30-minute intro call you receive an individual, binding quote: a fixed price for a clearly defined scope, time and materials, or monthly support after go-live.
Private clients receive the quote with the total price including VAT, businesses with net prices plus VAT, as set out in my terms and conditions (German). Consumers have a right of withdrawal (German).
How to choose a trading bot developer
Whether you work with me or with someone else: you can check these seven points yourself before you hire a developer.
- Precise questions about your rules. A good developer wants to see your rule set in writing and asks where it is unclear: entry, exit, position sizing and edge cases such as price gaps, partial fills or holidays.
- No promises of returns or win rates. Nobody can credibly promise that a strategy will make money in the future. Profit promises, “proven” strategies for sale or a share of your account's results are warning signs.
- A test report you can follow. It states the data period, the data source, the assumptions for spreads, slippage and commissions, the number of variants tested and a period outside the optimization (out-of-sample).
- Failure cases are planned for. Ask what the system does after a dropped connection, a rejected order or a restart, and how it can be shut down in an emergency. There should be a concrete answer.
- A test phase before going live. Before real capital is involved, the system runs on a demo or paper trading account, and it is clear in advance what acceptance is measured against.
- No credentials for your live account. A developer needs neither your password nor your two-factor code for the live account and makes no trading decisions for you. You trigger the live start yourself.
- Clear documents, verifiable identity. A quote with the scope of work, clear terms on source code and rights of use, terms and conditions and a legal notice are available before you hire, without pressure to decide quickly.
Feel free to hold me to the same standard and ask me about each of these points in the intro call.
Articles in English
In-depth articles, grouped by the questions that come up before you hire a developer.
Hire a developer or build it yourself?
- Hiring an Interactive Brokers API developer: specification, acceptance and code ownership
- Hire a trading bot developer or build it yourself with AI? Cost drivers and a decision guide
Which Interactive Brokers API fits, and how does a bot run around the clock?
- IBKR Web API vs TWS API: which one your trading bot needs
- ib_async vs ib_insync: migrating an Interactive Brokers bot
- Running IB Gateway headless in Docker after IBC: 2FA and restarts
Can TradingView alerts place orders at Interactive Brokers?
Built with Claude Code or ChatGPT: what to check before going live?
- Built a trading bot with Claude Code or ChatGPT? A pre-live checklist
- Claude or ChatGPT with Interactive Brokers via MCP: what works and what does not
MetaTrader 5 Expert Advisors and prop firm rules
- Prop firm EA rules in code: daily loss, max drawdown and news windows
- Expert Advisor not placing trades in MT5: a diagnostic checklist
Check the numbers yourself with the position size calculator, the risk-reward calculator, the Monte Carlo simulator and the backtest playground, or browse all free tools.
More articles in German on Interactive Brokers, MetaTrader 5, TradingView and running bots are collected in the topic hub Trading bots & broker APIs (German).
Frequently asked questions about trading bot development
How much does a trading bot cost?
It depends on scope and complexity: the number and type of rules, the platform, the depth of testing and whether AI components are added. That is why there is no fixed price list. After the free 30-minute intro call you receive an individual, binding quote: fixed price, time and materials, or monthly support. Private clients receive the total price including VAT.
How long does it take to develop an Expert Advisor or trading bot?
A simple MT5 strategy including backtest typically takes 2–4 weeks. More complex Python setups with machine learning components tend to take 6–12 weeks. I'll go over the schedule with you in the intro call; it also depends on how precisely the rules are already defined.
Which brokers and platforms do you support?
The focus is on MetaTrader 5 with MQL5, Interactive Brokers via Python (ib_async, the successor of ib_insync, and the TWS API, operated via TWS or IB Gateway) and ICM Capital with a FIX connection. For research, backtests and AI components I use the Python stack with pandas, NumPy, vectorbt, backtrader, scikit-learn and PyTorch. Whether another broker can be connected depends on its interface and is clarified in the intro call.
Can you review or fix an existing bot or Expert Advisor?
Yes. I analyze existing EAs and bots, look for bugs, weaknesses and risks in the code, improve them in a targeted way and document the changes so they can be traced. If you develop your own algorithms, code reviews are also available as coaching. The exact scope is set out in the individual quote.
Do you build EAs that follow prop firm rules such as daily loss limits?
Yes. Requirements such as daily loss limits are built into the system's code. Whether automated trading is allowed at all is something you check with the prop firm beforehand.
Do I get the source code?
You receive the complete, commented source code and may use it for your own business or private purposes, without limits on time or territory. Passing it on to third parties or reselling it requires my consent in text form, for example by email. The details are governed by my terms and conditions and your contract.
Is my strategy kept confidential?
Yes. Confidential information from our work together, including your trading rules, is not passed on to third parties. This obligation is set out in my terms and conditions and continues after our work together ends.
Where does the bot run, and who connects it to my live account?
The system runs on your side, for example on your own VPS, with monitoring. For development and testing you provide access to demo or test accounts and, where needed, to a VPS, server or API. You connect the system to your live trading account and activate live operation yourself; I don't trade on your accounts.
Do you provide trading signals or manage accounts?
No. I don't sell signals or strategies, I don't manage client money and I don't trade on client accounts. I don't offer investment or tax advice either. I develop software to your specification; trading decisions and the live start are your responsibility.
Can you make my strategy profitable?
No, nobody can credibly promise that: whether a strategy will make money in the future is uncertain. I implement your rules cleanly and test them honestly, with real spreads, slippage and commissions, walk-forward analysis and robustness checks. If the test shows that an idea is not robust, you know before real money is involved.
What do I need for the intro call?
A short description of your strategy or idea: market and instruments, timeframe, entry, exit and position sizing, as far as they are already defined. Plus the platform or broker you want to use, and existing code or backtests if there are any. The intro call takes 30 minutes and is free.
Do you work in English?
Yes. I work in English or German, remotely from Stuttgart and Mallorca. The language for the project is agreed in the intro call.
Do you work with clients outside Germany?
Yes, remotely. Contracts are based on my terms and conditions (available in German) and are governed by German law; consumers keep the protection of the mandatory law of the country where they habitually reside. The details are clarified in the intro call. This is a general note, not legal advice.
About me
I'm Marcel Gautsche, based in Stuttgart and Mallorca. I have been building automated trading systems and trading bots for MetaTrader 5 (MQL5) and Interactive Brokers (Python) for more than 10 years. I also run AI workshops and AI training for companies: more than 50 workshops so far.
I have focused on AI since 2022/23. Code, code reviews and backtests are my own work. More about me →
Briefly describe your strategy or idea, the platform you want to use and your goal. In the free 30-minute intro call, I'll work out with you whether and how it can be implemented. Afterward, you receive a quote.
Request a free intro callPrefer email? info@marcelgautsche.de
Last updated: November 2026