Service · Python

Python trading bot development for broker and exchange APIs

When MetaTrader is not enough: bots that trade through broker and exchange APIs, use data from anywhere, and run on your own server. Written in Python with risk limits, logging and alerts built in, and handed over as clean, documented source.

Mutual NDA before you share your strategy · reply within one working day

bot/risk.py17 lines
1# bot/risk.py: every order passes through here first2from dataclasses import dataclass3 4@dataclass5class RiskLimits:6    max_daily_loss_pct: float = 3.07    max_position_usd: float = 250008    max_open_orders: int = 49 10def allow(order, account, limits: RiskLimits) -> bool:11    day_pnl = account.pnl_today / account.equity_at_open * 10012    if day_pnl <= -limits.max_daily_loss_pct:13        log.warning("daily loss limit reached, order blocked: %s", order)14        return False15    if order.notional_usd > limits.max_position_usd:16        return False17    return len(account.open_orders) < limits.max_open_orders
Starting price
$500
Typical delivery
1–4 weeks
Revisions
2 revision rounds
Handover
Full source code + report
Scope

What I build in Python.

  1. 01

    Signal-to-execution bots

    Your signal, whether indicator logic, a TradingView alert or a model’s output, turned into sized orders with stops, limits and reconciliation.

  2. 02

    Portfolio and rebalancing bots

    Scheduled rebalancing, DCA and allocation rules for stocks, ETFs and crypto, with drift thresholds and cost controls.

  3. 03

    Research and backtesting pipelines

    Clean data loading, vectorised or event-driven backtests, and reports you can rerun when the data updates.

  4. 04

    Monitoring, alerts and dashboards

    Daily P&L, exposure and error alerts by Telegram or email, and a small web dashboard if you want one.

Connectivity

Brokers and exchanges I work with.

If your broker has a documented API, it can usually be connected. These are the most common.

Broker / exchangeMarketsInterface
OANDAForex, CFDsREST v20 + streaming
Interactive BrokersStocks, futures, options, forexTWS / Gateway API
AlpacaUS stocks, ETFs, cryptoREST + WebSocket
Binance, BybitCrypto spot and futuresREST + WebSocket
cTrader brokersForex, CFDscTrader Open API
MetaTrader 5 brokersForex, CFDs, futuresMetaTrader5 Python package
Indian brokers (Zerodha, Upstox, Angel One, Fyers, Dhan)NSE/BSE equity, F&OBroker APIs
Indian broker APIs are covered by SEBI’s retail algo framework, in force since 1 April 2026, which sets registration and hosting rules that vary by broker. I build for your own account, and we confirm your broker’s requirements during the brief.
Engineering

What separates a script from a bot you can leave running.

  1. 01

    Reconnects and rate limits

    Connections drop. The bot resubscribes, backs off when rate-limited, and never sends the same order twice.

  2. 02

    Idempotent orders

    Every order carries a client ID, so a retry after a timeout cannot open a second position.

  3. 03

    Reconciliation on start

    On every start the bot compares its state with the broker’s positions and orders, and trusts the broker.

  4. 04

    A kill switch

    One command, or one Telegram message, flattens positions and stops trading.

  5. 05

    Paper first

    Every bot runs against a paper or demo account before it touches live money.

Questions

Common questions

Which Python libraries do you use?

pandas and numpy for data, the broker’s official SDK or its REST/WebSocket API directly, asyncio for concurrency, and backtrader, vectorbt or a small custom engine for backtests. No obscure dependencies you will struggle to maintain.

Where does the bot run?

On your VPS or cloud server (DigitalOcean, AWS, Hetzner and similar), set up as a service that restarts on failure and writes logs. I can help you choose and set up the server.

Can a TradingView alert trigger the bot?

Yes. A small webhook receiver checks a secret in the alert, removes duplicates and places the order through your broker’s API. TradingView webhooks need a paid TradingView plan.

Can it use machine learning?

If you have a model, I can deploy it behind the same risk limits. If you want one researched, we treat it as a research project with out-of-sample validation, and I will tell you honestly if it does not beat a simple baseline.

Do you need my API keys?

Only paper or demo keys during development. Live keys stay in your server’s configuration, never in the code and never with me.

Tell me the strategy. I’ll tell you what it takes.

Fifteen minutes, no pitch. Mutual NDA before you describe anything you care about. You get an honest view of feasibility, timeline and price, even if the answer is “don’t build this”.

WhatsApp