Making a trading system trade with exchanges

As we saw in Chapter 7Building a Trading System in Python, a trading system is a piece of software that is capable of collecting financial data and sending orders to the market. This trading system has many functional components that are in charge of handling trading and risks, as well as monitoring the trading process that happens on one or many exchanges. When you code a trading strategy, it will become a component of the trading system. You will need input price information and your trading strategy as output. This will send trading indications. To complete this flow, we require gateways since they are the main components.

The following diagram shows the functional components of a trading system, the gateway's interface, and the outside world with the trading system. The gateways collect prices and market responses and send orders. Its main role is to initiate a connection and to convert the data that's sent from the outside world into the data structure that will be used in the trading system:

The following is shown in the preceding diagram:

  • When you implement your trading strategy, this trading strategy will be on your machine. The exchange will be located on another machine.
  • Since these two machines are on different sites, they need to communicate through a network.
  • Depending on the location of the system, the ways that are used to communicate can be different.
  • If the trading system is collocated (the machines are located in the same facility), a single wire will be used, which will reduce the network latency.
  • If we use a cloud solution, the internet could be another method of communication. In that case, the communication will be much slower than a direct connect one. 

Take a look at the following diagram, which depicts the communication taking place between the gateways:

The following is shown in the preceding diagram:

  • When we look closer at the communication that's handled by the gateways, we can observe that the venues can have different protocols.
  • The gateways will need to be able to process numerous protocols so that they can convert them into trading system data structures.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
44.192.75.131