Read time … min

AI-native runtime for IG trading strategies

Author IG Labs REST and Lightstreamer strategies in Cursor, Claude Code or any AI IDE. Deploy from GitHub into a managed cloud runtime with first-class MCP control, logs and region selection.

By the TradingHost engineering team

Section 01 · At a glance

At a glance

Broker
IG Group
Broker type
Forex, CFD and spread-betting broker (UK)
Asset class
Forex, indices, commodities, share CFDs, ETFs, options, bonds, cryptocurrencies (entity-dependent)
Supported products
17,000+ markets across spot FX, indices CFDs, commodities CFDs, share CFDs, ETF CFDs, options, bonds and (per entity) crypto CFDs. UK retail clients can place spread bets in addition to CFDs.
Runtime model
Containerised strategy runtime
Deployment source
GitHub
Languages
Any language that runs in a container
Common integrations
IG Labs REST API, Lightstreamer streaming, MetaTrader 4 bridge, NautilusTrader, custom connectors
AI workflow integration
MCP control surface for Cursor, Claude Code, GitHub Copilot and CLI agents
TradingHost role
Runtime, deployment, logs, health checks, region selection, MCP control
IG role
Broker account, API access, market access, execution venue
Regulators
IG Markets Limited (FCA firm reference 195355, UK); IG Markets Limited Australia branch (ASIC AFSL 220440); IG Markets South Africa (Pty) Ltd (FSCA); IG Markets Singapore branch (MAS); IG Bank S.A. (FINMA); IG Markets Bermuda Limited (BMA); IG US LLC (CFTC RFED).
Retail leverage caps
UK and EU (FCA, ESMA-aligned): 30:1 on major FX, 20:1 on non-major FX and gold, 10:1 on non-gold commodities and non-major indices, 5:1 on stocks, 2:1 on crypto CFDs. Australia (ASIC): mirrors ESMA caps. US (IG US LLC, NFA Rule 2-43b): 50:1 on major FX, 20:1 on non-major FX. South Africa (FSCA): higher leverage permitted per FSCA rules.
Affiliation
TradingHost is independent and is not affiliated with IG Group, any IG entity or tastyfx

Section 02 · What IG offers

What IG offers

IG offers more than 17,000 tradable markets covering spot FX, indices, commodities, share CFDs, ETFs, options and bonds via the IG Labs REST API and Lightstreamer streaming. Strategies authenticate with a three-token model (API key plus a CST and security token returned at session creation). Demo and live are separate environments with separate API key registrations. Market specifics, deal references and the full market list live in IG's documentation.

Markets and strategy patterns

  • REST strategies across 17,000+ tradable markets
  • FTSE 100, S&P 500, DAX 40 and Nasdaq 100 indices breakout
  • Share CFD pairs and basket strategies
  • EUR/USD and GBP/USD major-FX carry strategies
  • Lightstreamer-driven streaming-price strategies
  • Spread-bet versus CFD order routing (UK retail)
  • Demo-validated deployments promoted to live

API surface

Product surfaces
17,000+ markets across spot FX, indices CFDs, commodities CFDs, share CFDs, ETF CFDs, options and bonds. Crypto CFDs are entity-dependent. Demo environment (demo-api.ig.com) mirrors the production market list and lets a strategy validate against the same API surface without real capital.
Connection methods
IG Labs REST API for orders, accounts, positions, watchlists and historical data. Lightstreamer streaming endpoint for real-time prices, account balances, working orders and trade-confirmation events. MetaTrader 4 bridge for traders who want to use IG accounts from inside the MT4 terminal.
Authentication
Three-token model on REST: X-IG-API-KEY (long-lived API key registered at labs.ig.com), CST (Client Session Token returned by POST /session) and X-SECURITY-TOKEN (account-scoped session token returned alongside CST). All three are required on authenticated requests. Demo and live API keys are registered separately and are not interchangeable.

For specifics, refer to IG Labs

Specific endpoints, rate-limit caps, Lightstreamer subscription shapes, deal references, the full instrument list and version history live in IG's documentation. Treat these as the source of truth.

Section 03 · Build with AI

Build your IG strategy with AI

Pick an integration method, fork a TradingHost framework starter, and author your strategy in an AI IDE. Cursor, Claude Code, GitHub Copilot and CLI-based AI agents all work with the same GitHub-native deployment loop.

  • Native IG Labs REST

    Direct control over IG-specific behaviour, deal references, account state and Lightstreamer subscriptions.

  • trading-ig (Python wrapper)

    Maintained community wrapper around IG Labs REST and Lightstreamer. Familiar Python ergonomics for IG-specific deal handling.

  • NautilusTrader

    Python framework with an IG adapter for FX and indices, suitable for event-driven IG strategies that share code with backtests.

  • MetaTrader 4 or custom connector

    IG offers an MT4 bridge for EA-style strategies, or you can write your own integration on top of IG Labs REST and Lightstreamer.

Framework support for IG products

IG Labs REST and trading-ig span IG's full product surface. NautilusTrader covers FX and indices today, with share CFDs limited and crypto CFDs not supported. MetaTrader 4 bridges FX, indices and commodities only, and the strategy lives inside the MT4 terminal rather than a TradingHost container.

FrameworkFXIndicesCommoditiesCFDCrypto CFDs
Native IG Labs RESTSupportedSupportedSupportedSupportedPartially supported
trading-ig (Python)SupportedSupportedSupportedSupportedPartially supported
NautilusTraderSupportedSupportedSupportedPartially supportedNot documented as supported
MetaTrader 4 (IG MT4 bridge)SupportedSupportedSupportedNot documented as supportedNot documented as supported

✓ confirmed support per official IG and framework documentation. "limited" indicates partial framework adapter coverage. "no" indicates not supported by the framework or the bridge. Crypto CFDs depend on the IG entity. Workflow links target /workflows/ pages currently in authoring.

TradingHost does not force a framework. It runs your project.

Author with AI

The framework starters above pair naturally with AI IDEs. The TradingHost MCP control surface closes the loop: AI tools can inspect deployments, review logs and manage the runtime alongside you, never the trade execution path.

Section 04 · Run on TradingHost

Run your code on TradingHost

IG provides the broker account and API access. TradingHost provides the production environment where your IG-connected strategy runs.

Instead of running strategy code on a laptop, desktop machine, generic VPS or manually configured server, you deploy from GitHub into a TradingHost-managed container runtime.

You

  • Your repo contains your code.
  • Your deployment defines how it runs.
  • Your strategy connects to IG.

TradingHost

  • Keeps the runtime online.
  • Surfaces logs and health checks.
  • Region selection.
  • Controlled deployment surface.

Deployment flow

  1. STEP 01

    Connect GitHub

    Authorise TradingHost to access your GitHub account.

  2. STEP 02

    Link a repo or start from a framework

    Point TradingHost at your existing strategy repo, or fork a TradingHost framework runtime (NautilusTrader for IG, or the IG Labs REST starter built on trading-ig) for a working baseline.

  3. STEP 03

    Deploy into a TradingHost container

    Pick a region (EU for UK and EU IG entities, US-East for IG US LLC), supply the environment values your strategy needs (X-IG-API-KEY, IG account credentials, demo or live host), and deploy. TradingHost builds your container from the repo and runs your strategy on managed Kubernetes infrastructure. No local Docker install required.

  4. STEP 04

    Monitor logs and health

    Watch live logs, health and runtime state from the TradingHost dashboard. The same surface is reachable through MCP from any AI IDE, so Cursor, Claude Code or a CLI agent can read deployment state and manage the runtime alongside you.

  5. STEP 05

    Update and redeploy

    Push changes to your GitHub main branch and TradingHost redeploys automatically.

Section 05 · Operational notes

Operational notes for IG

Things that bite you when you actually run an IG strategy in a containerised cloud runtime, not in IG's marketing pages, not in third-party tutorials. Every claim below is paraphrased from IG Labs or the relevant regulator's register; the deployment-side guidance is from running these strategies on TradingHost.

  1. 01 · Three-token auth

    X-IG-API-KEY plus CST and X-SECURITY-TOKEN on every authenticated request

    IG Labs REST requires three headers in combination: X-IG-API-KEY is the long-lived API key registered at labs.ig.com; CST and X-SECURITY-TOKEN are short-lived session tokens returned by POST /session. The session tokens expire and must be refreshed by re-authenticating or by hitting the session refresh endpoint. A strategy that caches CST and security token without a refresh path will start returning 401 after the session window closes. Store the API key as a TradingHost Secret; treat CST and security token as in-memory state, not as secrets.

  2. 02 · Host split

    Demo and live are separate hosts with separate API key registrations

    Live host is api.ig.com/gateway/deal/; demo host is demo-api.ig.com/gateway/deal/. The two environments have separate API key registrations at labs.ig.com (the registration form asks which environment the key is for at sign-up). A demo key cannot authenticate against the live host and vice versa. Keep demo and live keys in separate TradingHost Secrets entries and never share an .env between environments.

  3. 03 · Streaming

    Lightstreamer rather than raw WebSocket

    IG's streaming surface is Lightstreamer, not a bare WebSocket protocol. Strategies use the Lightstreamer client library (Java, .NET, JavaScript, Python, others) to subscribe to topic-style channels for prices, account balances, working orders and trade-confirmation events. Bring the appropriate Lightstreamer client into your container image; do not try to speak Lightstreamer protocol by hand. Reconnect behaviour, throttling and bandwidth-shaping are handled by the client library.

  4. 04 · Rate limits

    Per-API-key request caps; respect documented rate tiers

    IG Labs documents per-API-key rate limits split across trading, non-trading and historic-price endpoints. Exceeding the cap returns rate-limit errors. Strategies should call /session sparingly (re-authenticate only when CST or X-SECURITY-TOKEN expires) and prefer Lightstreamer subscriptions over polling REST for price data. Specific request-per-minute caps live in the IG Labs reference and change over time; treat the docs as authoritative.

  5. 05 · Spread bet vs CFD

    UK retail clients place spread bets or CFDs, with distinct deal references

    IG's UK retail product range includes both CFDs and spread bets; the latter is a UK-specific tax-advantaged instrument. Spread-bet orders and CFD orders use different deal references and route to different sub-accounts within the same IG client account. A strategy that hard-codes "CFD" account type cannot place spread-bet trades, and vice versa. Read the IG account type at session creation and branch order routing accordingly.

  6. 06 · Multiple entities

    Leverage and product availability depend on the IG entity holding the account

    IG Markets Limited (UK, FCA firm reference 195355) operates under ESMA-aligned retail leverage caps. IG Markets Limited Australia branch (ASIC AFSL 220440) mirrors those caps since March 2021. IG Markets South Africa (Pty) Ltd (FSCA) offers higher leverage. IG US LLC (CFTC RFED) operates under NFA Rule 2-43b. The API surface is the same across entities, but a strategy that assumes "30:1 majors" hard-codes itself to the UK or EU entity. Read leverage and entity at /accounts and branch sizing accordingly.

  7. 07 · Trade reporting

    EMIR, MiFID II and Dodd-Frank reporting is IG's responsibility

    IG Markets Limited reports under EMIR and MiFID II as a UK-authorised investment firm. IG US LLC reports under Dodd-Frank Title VII swap-data-reporting rules. IG Markets Limited Australia branch reports under ASIC derivative-trade-reporting rules. TradingHost does not perform regulatory trade reporting on your behalf and is not a reporting service. The strategy code you run on TradingHost is your own algorithmic activity; reporting attaches to the IG entity holding the account.

Section 06 · Built for

Built for

TradingHost IG runtimes are best suited to:

  • Developers building strategies in AI IDEs (Cursor, Claude Code)
  • Quant FX and indices strategy developers
  • Share CFD and ETF systematic traders
  • NautilusTrader and trading-ig users
  • Teams moving from MetaTrader and VPS hosting to containerised deployment

Connecting GitHub and creating your first strategy is free.

Section 08 · FAQ

FAQ

No. TradingHost is independent and is not affiliated with IG Group, any IG entity or tastyfx.

No. TradingHost is not a broker and is not a registered investment firm. TradingHost is a cloud runtime that runs your strategy code. The broker relationship, the account, the leverage, the execution and the regulatory protections all live with IG. You sign up directly with the IG entity appropriate to your jurisdiction.

No. Your strategy code connects to IG and sends instructions according to your own logic, account permissions and integration method. TradingHost provides the runtime where that code runs.

No. IG Labs REST and Lightstreamer access is provided by IG. You register the X-IG-API-KEY at labs.ig.com and you are responsible for your IG account, API key rotation and compliance with IG's terms.

Yes. The community Python wrapper trading-ig wraps both IG Labs REST and Lightstreamer streaming with idiomatic Python. Or call IG Labs REST directly with any HTTP client.

Yes. TradingHost supports any language that can run inside a container. IG Labs REST is HTTP, and Lightstreamer ships clients for Java, .NET, JavaScript, Python and several other runtimes.

Yes, if your project is designed that way. You can run multiple strategy processes or services inside one runtime, or separate them into different runtimes for isolation and operational clarity.

TradingHost runs containerised cloud workloads, not MetaTrader 4 or MetaTrader 5 desktop terminals. If your IG strategy is an MT4 Expert Advisor compiled in MQL, that EA runs inside the MetaTrader terminal and traditionally needs a Windows VPS to stay online. For TradingHost, port the logic to IG Labs REST or Lightstreamer; that becomes the TradingHost-compatible shape. See how TradingHost compares to a VPS for the boundary.

Register an IG Labs API key at labs.ig.com for the environment you plan to deploy against (demo or live). Fork a TradingHost framework runtime built on trading-ig, or connect your own GitHub strategy repo. Linking a GitHub repo and creating a strategy is free; runtime plans are listed on the pricing page.

Yes. Leverage is set by the IG entity that holds your account, not by TradingHost. IG Markets Limited (UK, FCA) and IG Markets Limited Australia branch (ASIC) cap major FX at 30:1, non-major FX and gold at 20:1, other commodities at 10:1, stocks at 5:1 and crypto CFDs at 2:1 per ESMA-aligned rules. IG Markets South Africa (Pty) Ltd (FSCA) permits higher leverage. IG US LLC (CFTC RFED) operates under NFA Rule 2-43b (50:1 majors, 20:1 non-majors). The API surface is the same across entities.

In your GitHub-controlled secrets workflow. TradingHost reads the X-IG-API-KEY at runtime through GitHub repository secrets, environment secrets or your own approved secret-management process. CST and X-SECURITY-TOKEN are session tokens, not secrets, and live in process memory.

Yes. TradingHost supports MCP-based control for AI IDEs including Cursor, Claude Code, GitHub Copilot and CLI-based AI agents. AI tools can inspect deployments, review logs, restart strategies and manage runtime workflows. MCP is a control and observability surface, not the trade execution path.

No. EMIR and MiFID II trade reporting is the broker's responsibility. IG Markets Limited reports under EMIR and MiFID II as a UK-authorised investment firm. IG US LLC reports under Dodd-Frank Title VII swap-data-reporting rules. IG Markets Limited Australia branch reports under ASIC derivative-trade-reporting rules. TradingHost runs your code; the IG entity holding the account handles regulatory reporting.

No. TradingHost is focused on production runtime and deployment. Backtesting belongs in your research stack, framework (NautilusTrader's backtester, custom Python, vectorbt) or in AlgoBuilder.