⚙️ Tools & automation

Running a Python Trading Bot on SuperFunded × TradeLocker in Live Production: The Full MQL-Free Tech Stack

Published: 7/9/2026

The old assumption that "automated trading on a prop firm = an MT4/MT5 EA" is already half-outdated.

We're currently running a trading bot written in Python in live production on a SuperFunded TradeLocker account. We use no MetaTrader at all. No TradingView webhook, no signal bridge either. This setup calls TradeLocker's official API directly from Python.

This article walks through the tech stack, design, and operational setup of the bot that's actually running. It's written for people who "don't want to write MQL but still want a bot running" or who want to know "can I automate trading on a firm that uses TradeLocker?"

⚠️ Whether automated trading is allowed, and under what conditions, varies by firm. SuperFunded allows EAs/automated trading (HFT and arbitrage are banned), but always check the official rules before running anything. See the 19-firm EA rules comparison here.

Why TradeLocker lets you write this in Python

Automated trading on MT4/MT5 assumes the MQL language and a terminal running persistently, but TradeLocker's philosophy is different.

  • An official REST API is publicly available (covering order placement, closing, position lookup, account status, and price data)
  • The official Python library tradelocker installs via pip
  • Since it connects directly to the broker's execution server, a persistently running terminal isn't required

In other words, instead of "attach an EA to a chart and leave the PC running 24/7," you can write the bot as an ordinary Python program and deploy it with ordinary server operations.

Connecting only takes this much:

Python
from tradelocker import TLAPI
tl = TLAPI(
environment="https://live.tradelocker.com", # demo uses demo.tradelocker.com
username="your@email.com",
password="********",
server="YOUR_SERVER", # the server name provided by your firm
)

The library handles fetching and auto-refreshing the JWT token for you.

The tech stack of the bot in live production

Here's the actual configuration of the bot running on SuperFunded. It was originally written as a time-window-based gold strategy in MQL5 as an EA, then ported to Python.

LayerTechnology usedRole
LanguagePython 3.11+The bot itself (uses type hints, dataclasses)
Trading APItradelocker (official pip package)Auth, order placement, closing, lookups. Built-in retries and automatic JWT refresh
Configpython-dotenv + environment variablesKeeps credentials and strategy parameters separate in .env
State storeLocal JSON ⇔ Firestore (swappable)Persists the day's entry state (the key to idempotency)
Execution platformCloud Run Job + Cloud SchedulerServerless — "spin up once a minute, only during the time window that matters"
ContainerDockerThe Cloud Run image (python bot.py --once)
Alternate setupsystemd (persistent VM)Restart=always, safe shutdown on SIGTERM
TestingunittestUnit-tests the trading logic without any network calls

The key point is making the state store swappable. For local verification it's state.json; in serverless production it's Firestore — the same code lets you choose the runtime environment.

The core of the design: "state reconciliation"

When running a bot on a prop account, the scariest thing is double orders and orphaned positions. With drawdown rules in play, "I ended up holding twice the intended lot size" can kill the account instantly.

Rather than an imperative "place the order when the time comes" model, this bot is designed to compare the "state that should exist" against the "state that actually exists" every tick, and only execute the difference. It's the same idea as a Kubernetes reconcile loop.

Code
Every tick:
1. Compute the set of positions that should currently be held (a pure function)
2. Query the account's actual positions (get_all_positions)
3. Execute the diff:
- Should exist but doesn't, and no entry made today → place a market order (with SL)
- Exists but shouldn't → close it
- 2+ positions share the same tag → close the excess (insurance against double orders)

With this design, the bot itself becomes nearly stateless, which means:

  • It's safe even after a restart, since it queries the current state before acting
  • Running it once a minute serverless doesn't cause double orders (idempotent)
  • It never touches positions you opened manually

strategy_id stands in for MagicNumber

On MT4/MT5, MagicNumber identifies which EA owns a position, but on TradeLocker you can attach a strategy_id tag at order time and read it back when querying positions:

Python
# Tag the order at placement time (SL is specified as an absolute price)
tl.create_order(
instrument_id, quantity=lot, side="buy", type_="market",
strategy_id="mybot_1",
stop_loss=sl_price, stop_loss_type="absolute",
)
# Filter for just your own positions by tag when querying
df = tl.get_all_positions()
mine = df[df["strategyId"].str.startswith("mybot_", na=False)]

This lets you safely coexist with manual trades and other strategies.

Watch out for the official library's automatic retries

The tradelocker package automatically retries a failed POST up to 3 times on a communication error. This is convenient, but if a retry fires after a timeout, the order can end up going through twice. As a safeguard, the bot checks the position count for the same strategy_id on the tick right after placing an order, and automatically closes any excess if there are 2 or more. If you're going to coexist with a prop firm's drawdown rules through automated trading, this kind of "insurance layer" is essentially mandatory.

Serverless operation: runs almost entirely within GCP's free tier

There's no need to run a VM continuously. Since this strategy trades only during a fixed time window, I set it up so that Cloud Scheduler fires a Cloud Run Job once a minute, only during the trading window.

  • A single run takes a few seconds (connect → reconcile → exit)
  • State is a single Firestore document
  • Fewer than 100 invocations per day → essentially within GCP's free tier
  • Since the SL sits on the broker's side, the bot doesn't need to stay running while a position is open

Not needing the "few-thousand-yen-a-month Windows VPS" that was standard for running MT4/MT5 EAs is one of the hidden big advantages of the TradeLocker × Python approach.

The safety gate for live order placement

To prevent accidents, live-environment order placement is locked behind a triple gate of environment variables:

Code
TL_ENV=live AND TL_DRY_RUN=false AND TL_CONFIRM_LIVE=YES

Unless all three line up, it won't start. In DRY-RUN mode, no orders are placed — it only logs what it would do — so the workflow is to run it on demo for a few days first before promoting it to production.

Gotchas (things we actually hit in live production)

  1. Account-state key names are server-defined: the keys in the dict returned by get_account_state() depend on the broker's configuration. balance is nearly universal, but the equity equivalent is sometimes projectedBalance, so it's safer to pull from a list of candidate keys rather than hard-coding one.
  2. Symbol names differ by firm: some accounts have gold as XAUUSD, others as GOLD. Check first whether it resolves via get_instrument_id_from_symbol_name().
  3. Order rejection right after the weekend: early Monday, before the market reopens, orders get rejected. Building in "retry on the next tick if rejected" lets it automatically catch up once trading resumes (this happens naturally if you use the reconciliation design).
  4. Spread guard: spreads widen right after reopening or during thin-liquidity hours. It's a good idea to check the ask-bid spread before placing an order and skip it if the spread exceeds a threshold.

Automating the P&L record too: the tracker now supports TradeLocker

To go along with this live deployment, our own P&L tracker now supports TradeLocker as well. It's a Python script that periodically pulls balance, floating equity, and daily P&L via the official API and sends it to prop-memo.com — just drop it in the same .env and on the same machine as the bot to get it running (it's record-only and never places orders).

👉 TradeLocker tracker setup guide

It feeds into the same API key and the same P&L page as the MT4/MT5 EA version and the cTrader cBot version, so even when running multiple firms — "EAs for MetaTrader firms, Python for SuperFunded" — you can manage your P&L in one place.

Summary: TradeLocker-based firms are a target for "code-first" traders

  • SuperFunded allows EAs/automated trading (HFT and arbitrage are banned), and TradeLocker's official Python API is usable
  • No MQL, no persistent terminal, no Windows VPS required. You can write the bot with ordinary Python engineering
  • If you're going to run this on a prop account, an idempotent state-reconciliation design plus insurance against double orders is essentially mandatory
  • With a Cloud Run Job + Scheduler setup, it runs for almost nothing

Firm selection now needs to account for not just "can I use an EA" but "which platform, and how can I actually automate it." For SuperFunded's rule details, see the complete guide; for EA policies across firms, see the 19-firm comparison.


Last updated: July 9, 2026

Written by

Hosono P | the prop firm strategist

I buy challenges with my own money and record everything through to the payout. Recorded payouts: ¥6.1M in total from Fintokei, Fundora and Funded7, plus $4,776 from The5ers (as of September 2026). Author of the semi-discretionary EA "ELDRA".

Profile and payout recordX @hosono_p

📚Related articles

⚙️

How to connect multiple prop firm accounts at once in NinjaTrader: running FTMO Futures and FundedNext Futures on a single NinjaTrader [September 2026]

Tradovate-based futures props like FTMO Futures and FundedNext Futures each issue a separate NinjaTrader login per firm. This walks through the exact steps used to connect accounts from multiple firms at once on a single NinjaTrader 8 (turning on Multi-provider in Settings and adding a 'NinjaTrader' connection for each firm).

Tools & automation9/27/2026
⚙️

ELDRA × AI Agents for Beginners: From Chatting to Setup, Safety Guards, and Backtesting

A beginner-friendly, step-by-step guide to using the semi-discretionary EA 'ELDRA' with an AI agent (Claude Code) and prop-memo's MCP. Covers connecting, checking whether your strategy can be built, safety guards matched to prop firm rules, creating a .set file, automating backtests, and optimization pitfalls.

Tools & automation9/26/2026
⚙️

Can You Use an EA at a Prop Firm? A Deep Dive Into Automated-Trading Rules at All 19 Firms + How to Use ELDRA

A quick-reference table of 19 prop firms' rules on off-the-shelf EAs, self-built EAs, source-code requirements, and tick-scalping restrictions. Covers MT4/MT5 support, a TradeLocker-API Python bot case study, and how to use prop-memo.com's EA Tracker together with the semi-discretionary EA ELDRA.

Tools & automation4/22/2026
🛡️

Prop Firms That Won't Let You Change Strategy: Official Rules Checked | TradingCult Bans EAs Outright, Funded7 Disqualifies Running the Same EA Across Multiple Accounts [September 2026]

TradingCult bans EA and bot use outright, and a violation is a hard breach. The firm and FundedElite also explicitly ban 'account rolling.' At Funded7, even your own EA gets you disqualified for Group Trading if its results correlate too closely with another trader's. SuperFunded allows news trading freely during the evaluation but bans it within ±10 minutes only at the Funded stage, and FundedElite's strategy risk limit only applies at the funded stage — this article rounds up 9 firms whose rules change between the challenge and funded stages, based on each firm's official FAQ.

Risk management9/5/2026
🧪

What's SuperFunded's Expected Value? Running a 1-Year Simulation of 1 Step and 2 Step Shows 2 Step Wins at 1% Risk or More (September 2026)

A one-year Monte Carlo simulation of SuperFunded's (a TradeLocker prop firm) 1 Step and 2 Step plans, run exactly to the official rules. Covers the annual take-home at 0.5%, 1%, and 1.5% risk per trade and win rates of 50-58%, 1 Step's trailing max loss, the 5% profit cap on the first three payouts, and 2 Step's 70% → 80% → 90% profit split.

Research9/27/2026
🧪

[September 2026] We Calculated BluSky's Expected Value: The 3-Stage Model Favors Propel (30OFF), +$2,988/Year at Zero Edge

We compared the three plans (Launch, Propel, Orbit) at futures prop BluSky Trading using a Monte Carlo simulation run for one year, from evaluation through payout. Verified pricing, reset fees, the Buffer Zone, and payout terms on the official help center and pricing page on September 25, 2026. It's a 3-stage model — Evaluation → Buffer Zone → Sim Funded — and failing the Buffer Zone doesn't send you back to redo the evaluation. At 0.30 lots and zero edge, Propel $50K (code 30OFF brings it to $112/month) is best at +$2,988/year. Orbit's 30-day deadline is a heavy burden, and it comes out negative at zero edge.

Research9/25/2026