A stockbroker is an intermediary between investors and exchanges. It facilitates trades and usually holds clients’ shares, while its supported exchanges, fees, data timing, and regulatory conditions vary. section 11.4.1
For a programmer, a broker is both a financial service and an access layer. Alpaca and Interactive Brokers provide Python APIs for account balances and programmatic orders, but automation depends on API availability and broker suitability. section 6.3 section 11.4
Evaluate a broker before connecting it to an investment workflow:
- Confirm that it serves your country and supports the exchanges and assets you need. section 6.3 section 11.4.1
- Compare order and transfer fees, because transaction costs affect gains and losses. section 6.3
- Check whether the broker offers a usable API and investigate its seriousness before automating. section 6.3
- Prepare identification and tax-residency information for mandatory Know Your Customer checks. section 6.3
A broker-aware portfolio table
A unified DataFrame can merge holdings from multiple brokers using Ticker, number of shares, average price, exchange, and Broker fields. The Broker value identifies whether each row came from INTERACTIVE_BROKER or ALPACA, allowing account data to be processed consistently. section 6.3
Figure 11.4 On an exchange, sellers and buyers can interact directly. A broker is an entity between a buyer and a seller. A broker usually facilitates trading on one or more exchanges.
Use the exchange-versus-broker diagram to distinguish direct interaction between buyers and sellers from the broker’s intermediary role. section 11.4.1
