In this chapter, we were introduced to the evolution of trading from the pits to the electronic trading platform, and learned how algorithmic trading came about. We looked at some brokers offering API access to their trading service offering. To help us get started on our journey of developing an algorithmic trading system, we used the Oanda v20 library to implement a mean-reversion trading system.
In designing an event-driven broker interface class, we defined event handlers for listening to orders, prices, and position updates. Child classes inheriting the Broker class simply extend this interface class with broker-specific functions, while still keeping the underlying trading functions compatible with our trading system. We successfully tested the connection with our broker by getting market prices, sending a market order, and receiving position updates.
We discussed...