Accelerate the value of multicloud with collaborative DevSecOps Learn more

Archived | Place trades through your online broker using simple API calls

Archived content

Archive date: 2019-05-01

This content is no longer being updated or maintained. The content is provided “as is.” Given the rapid evolution of technology, some content, steps, or illustrations may have changed.


Financial markets change rapidly at a moment’s notice, so it’s critical for people who are immersed in this industry to be in control and connected to their investments at all times. Historically, this has been a challenge because there isn’t a common framework among brokerages and financial institutions that enables them to make trading decisions and process transactions quickly and without hassle. TradeIT does just that by providing an API infrastructure that links retail investors and app developers with any online financial broker. When coupled with IBM’s own tools for managing investments, rebalancing and building portfolios, and projecting future earnings — this process strengthens the connections between users and their investments.


Nobody likes losing money in the market. Investors want to be informed at all times about the current state of the market and need to be ready to make trades at a moment’s notice. Imagine you are a financial institution that wants to provide its client base with the capability to trade stocks, exchange-traded funds, and currencies without having to leave your platform and manage relationships with external brokerage firms. To achieve this, you need a way to securely integrate with online brokers for your users and allow them to make trades directly and seamlessly with their connected accounts. TradeIT enables these capabilities by providing an API infrastructure that links retail investors and financial institutions with online financial brokers.

This code pattern shows you how to create a web application built on Node.js that integrates with the TradeIt APIs to give users an end-to-end way of making trades (buying or selling securities) against a mock brokerage. The application showcases the workflow of a customer authenticating themselves against this mock broker, and placing trades through them securely. After selecting the specific options for the trade, the user is returned a summary of a trade ticket to review, and receives the order number and confirmation of the trade.

This code pattern is for developers who want to start building applications with TradeIt integration. When you have completed this code pattern, you will understand how to:

  • Build a Node.js web application that’s integrated with the TradeIt SDK.
  • Store user authentication sessions to allow for multiple trades while signed in.
  • Issue multiple trades based on portfolio optimization results


Flow diagram

  1. User enters the web app and selects a broker from the available integrations.
  2. User enters their credentials to link with the broker.
  3. User selects his account for transactions and proceeds to the trading ticket to fill in information regarding the trade to be made, like the ticker name, stock quantity, and whether the trade is a buy or a sell.
  4. User reviews the details of the trade and confirms the trade.
  5. Trade details are then sent to the broker and a confirmation code is returned to the user.
  6. User can proceed to make another trade which takes him back to the trading ticket.
  7. User can securely log out of the session with the broker and go back to the homepage.


Find the detailed steps for this pattern in the README. Those steps will show you how to manually deploy your app to a local machine:

  1. Set up your machine.
  2. Clone the repository.
  3. Create the Investment Portfolio service.
  4. Configure the .env file.
  5. Create the TradeIt service.
  6. Run the application with NPM.