While25 - Programmable Trading Platform
homeomsrmschartspythonaicompareblogsupportGet While25
While25

A programmable trading platform.

Get While25Book a call

Order managementRisk managementChartsAI assistantCompare

Python SDKAPIDownload

AboutBlogCareersSupportContact

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 broker · Interactive Brokers

Interactive Brokers

No API key to copy. You run IB Gateway on your own machine, log into it with your paper account, and While25 talks to it over localhost.

Time
About 20 minutes
Difficulty
Most setup, most markets
Costs
Free. Market data is extra
You end up with
IB Gateway running on port 4002

Before you start

  • An Interactive Brokers account. Every live account comes with a paper account; the paper login is a separate username and password you set in Client Portal.
  • The Gateway installer includes Java. You do not install it separately.
  • Start on paper, on port 4002. Moving to live is the same setup on port 4001, after you have watched it work.
  1. 01

    Download IB Gateway, not Trader Workstation

    Take the stable build from interactivebrokers.com/en/trading/ibgateway-stable.php for Mac, Windows or Linux. Gateway is the small, headless sibling of TWS: no charts, no order tickets, just the connection. It uses a fraction of the memory and it does not fight your platform for the screen.
    interactivebrokers.com/en/trading/ibgateway-stable.phpIB Gateway downloadWindowsmacOS1LinuxVersionStableDownload2
    1 · Your platform. 2 · Take the stable build, not the latest.
  2. 02

    Launch it and choose IB API mode

    On the first screen Gateway asks whether you want IB API or FIX CTCI. Choose IB API. Then log in with your paper username and password and set the trading mode to Paper Trading.

    The paper login is not your live username. If you have never used it, 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, go to Configure → Settings → API → Settings. In Trader Workstation the same page lives under File, then Global Configuration, then API.
  4. 04

    Tick four things and remember the port

    Enable socket clients, decide whether the API may place orders, set the port, and trust your own machine.

    Read-Only API is the safety switch. Leave it ticked while you are still looking around: IBKR refuses every order from the API. Untick it when you want While25 to trade.

    Configure · API · SettingsEnable ActiveX and Socket Clients1Read-Only API2Socket port40023Trusted IPs127.0.0.14Master API client IDoptionalOK
    1 · On (Gateway sets this itself). 2 · Off to place orders, on while you are only watching. 3 · 4002 paper, 4001 live. 4 · Add 127.0.0.1.
  5. 05

    Leave Gateway running, and point While25 at it

    While25's IBKR connector dials 127.0.0.1:4002 for paper or 127.0.0.1:4001 for live. Nothing leaves your machine except the Gateway's own link to IBKR: we hold none of your keys, and none of your orders passes through our servers.
    The pathWhile25 Desktopyour machine↓ localhost127.0.0.1:4002IB Gatewayyour machine↓ the internetIBKR
    One hop on your own machine, then the Gateway's own connection.
  6. 06

    Know that it logs out once a day

    IBKR restarts its servers daily, so Gateway asks you to log in again. In Configure → Settings → Lock and Exit you can set the auto-restart time to something outside your trading hours. A Gateway that has quietly logged out looks exactly like a broken connection.

What While25 needs

Host
127.0.0.1. Gateway runs beside While25 on the same machine.
Port
4002 for paper, 4001 for live. TWS uses 7497 and 7496 instead.
No key, no secret
The Gateway session is the credential. Nothing to copy, nothing to store.

Because the session lives in Gateway, 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 it is on the other port. Paper is 4002 and live is 4001; if you launched TWS by mistake the ports are 7497 and 7496.

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.