11 Algorithmic trading

 

This chapter covers

  • Quantitative analysis
  • Testing strategies using backtesting
  • Catalysts as game changers
  • The difference between exchanges and brokers
  • Executing orders with Python
  • Order types and modalities

After mastering technical analysis with charts, this chapter introduces algorithms for trading strategies, transforming raw insights into actions. This step is the culmination of everything we've covered: collecting data, analyzing ratios and charts, assessing risks, and integrating ML and LLMs. We’ll bring it all together and outline scenarios for applying it.

Various scenarios affect trading strategies. Some algorithms perform better in bull markets than bear markets or vice versa. Catalysts are specific moments that signal more volatility in the market, which can be an opportunity or risk. We will review catalysts from a trading perspective.

In the third part of this chapter, we'll demonstrate how to place orders programmatically using Interactive Brokers and Alpaca. We'll explore different order types, parameters, and their implications, learning how to apply them effectively.

11.1 Non-financial data

11.1.1 Big data by example

11.2 Catalysts

11.2.1 Mergers and acquisitions

11.2.2 Bankruptcy

11.2.3 Earnings calls

11.2.4 Disasters

11.2.5 Interest rate changes

11.3 Trading algorithms

11.3.1 Backtesting

11.3.2 Complex trading signals

11.4 Orders

11.4.1 Exchanges vs brokers

11.4.2 Order modifiers

11.4.3 Executing orders

11.5 Summary