While25 - Programmable Trading Platform
Home
SDK
BlogCardsSupportDownload
While25

A programmable trading platform.

Download While25Book a call

Order managementRisk managementChartsAI assistantCompare

Python SDKSDKDownload

AboutBlogWhile CardsCareersSupportContact

Interactive BrokersAlpacaZerodhaUpstoxAll brokers

TermsPrivacyLicenceRiskAIAcceptable useNotices

While25 is software. It is not a broker, dealer, exchange or investment adviser, and nothing on this site is a recommendation to buy or sell any instrument. Orders you place route to your own brokerage account; While25 never holds funds or securities.

Trading carries risk of loss, including losses greater than your deposit on leveraged products. Backtests and simulations do not predict future returns. Broker and exchange names are trademarks of their owners. We plan to add Coinbase, Binance and Robinhood; you cannot connect them yet.

© 2026 While25

while25
Connect a brokerInteractive Brokers logo

Interactive Brokers

No API key. You run IB Gateway on your own machine and While25 talks to it over localhost.

About 5 minutes · Most setup, most markets · Free, market data extra · IB Gateway on port 4002

Watch: IB Gateway set up in about a minute

Before you start

  • An Interactive Brokers account. Every live account comes with a paper account; its login is a separate username and password you set in Client Portal.
  • Nothing else to install. The Gateway installer includes Java.
  • Start on paper. Live is the same setup with your live login, and the port stays 4002.
  1. 01

    Download IB Gateway, not Trader Workstation

    Take the stable build from interactivebrokers.com/en/trading/ibgateway-stable.php ↗. Gateway is the headless sibling of TWS: just the connection, a fraction of the memory.
    interactivebrokers.com/en/trading/ibgateway-stable.phpIB Gateway downloadWindowsmacOS1LinuxVersionStableDownload2
    1 · Your platform. 2 · The stable build, not the latest.
  2. 02

    Launch it and choose IB API mode

    Pick IB API, not FIX CTCI. Log in with your paper username and password and set the mode to Paper Trading.

    The paper login is not your live username. Set it in Client Portal under Settings, then Paper Trading Account.

    IB Gateway · loginIB API1FIX CTCIUsernameyouruser2Password••••••••••Live TradingPaper Trading3Log In
    1 · IB API. 2 · Your paper username. 3 · Paper Trading.
  3. 03

    Open the API settings

    In Gateway: Configure → Settings → API → Settings. In Trader Workstation the same page is under File, Global Configuration, API.
  4. 04

    Set the port to 4002 and untick Read-Only API

    Enable socket clients, set Socket port to 4002, and add 127.0.0.1 to Trusted IPs.

    Read-Only API must be unticked. While it is ticked, IBKR refuses every order While25 sends, with no reason given.

    Configure · API · SettingsEnable ActiveX and Socket Clients1Read-Only API2Socket port40023Trusted IPs127.0.0.14Master API client IDoptionalOK
    1 · On. 2 · Off, or no order goes through. 3 · 4002, for paper and live alike. 4 · Add 127.0.0.1.
  5. 05

    Leave Gateway running and open While25

    While25 dials 127.0.0.1:4002 on your machine. Nothing leaves it except Gateway's own link to IBKR: no keys, and no order passes through our servers.
    The pathWhile25 Desktopyour machine↓ localhost127.0.0.1:4002IB Gatewayyour machine↓ the internetIBKR
    One hop on your own machine, then Gateway's own connection.
  6. 06

    It logs out once a day

    IBKR restarts its servers daily and Gateway asks you to log in again. Set the auto-restart time outside your trading hours in Configure → Settings → Lock and Exit.

What While25 needs

Host
127.0.0.1. Gateway runs beside While25 on the same machine.
Port
4002, for paper and live alike. Gateway suggests 4001 for a live login: change it to 4002.
No key, no secret
The Gateway session is the credential. Nothing to copy, nothing to store.

Anything that closes Gateway closes your connection: a laptop asleep, an overnight restart, the daily logout.

When it does not work

While25 cannot connect at all+

Gateway is not running, or its socket port is not 4002. A live login defaults to 4001 and Trader Workstation to 7497: set 4002 in Configure, Settings, API, Settings.

IBKR refuses orders with no reason given+

Read-Only API is still ticked. Untick it in Configure, Settings, API, Settings, then reconnect.

It connects, then drops at the same time every day+

That is the daily restart. Set the auto-restart time in Lock and Exit to a quiet hour.

A dialog asks me to accept an incoming connection+

Add 127.0.0.1 to Trusted IPs so your own machine stops being questioned.

Prices are missing on some instruments+

IBKR market data is a separate subscription per exchange. A paper account inherits whatever the live account subscribes to.

Straight from Interactive Brokers

  • IBKR · Download IB Gateway (stable) ↗
  • IBKR · API settings reference ↗
  • IBKR Campus · Installing and configuring for the API ↗

Want something quicker for a first look? Alpaca takes about five minutes.