Strategy class

This class represents the trading strategy based on top of the book changes. This trading strategy will create an order when the top of the book is crossed. This means when there is a potential arbitrage situation. When the bid value is higher than the ask value, we can send an order to buy and sell at the same time and make money out of these two transactions.

This class is divided into two parts:

  • Signal part: This part handles the trading signal. In this example, a signal will be triggered when the top of the book is crossed.
  • Execution part: This part handles the execution of the orders. It will be responsible of managing the order life cycle.

The following are the steps for the strategy class:

  1. As shown in the following ...

Get Learn Algorithmic Trading now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.