Use your programming skills to create and optimize high-frequency trading systems in no time with Java, C++, and Python Key Features โข Learn how to build high-frequency trading systems with ultra-low latency โข Understand the critical components of a trading system โข Optimize your systems with
Developing High-Frequency Trading Systems: Learn How to Implement High-Frequency Trading From Scratch With C++ or Java Basics
โ Scribed by Developing High-Frequency Trading Systems: Learn How to Implement High-Frequency Trading From Scratch With C++ or Java Basics
- Tongue
- English
- Leaves
- 321
- Category
- Library
No coin nor oath required. For personal study only.
โฆ Table of Contents
Cover
Title Page
Copyright and Credits
Contributors
Table of Contents
Preface
Part 1: Trading Strategies, Trading Systems, and Exchanges
Chapter 1: Fundamentals of a High-Frequency Trading System
History of HFT
The post-1930s era
The modern era
Why have HFT?
What makes HFT so different from regular trading?
Effect of dark pools
Who trades HFT?
What do I need to start an HFT?
What are HFT strategies?
Asset classes
Liquidity
Tick-by-tick data and data distribution
Liquidity rebates
Matching engine
Market making
Scalping
Statistical arbitrage
Latency arbitrage
Impact of news
Momentum ignition
Rebate strategies
Pinging
Illegal activities
Summary
Chapter 2: The Critical Components of a Trading System
Understanding the trading system
Trading system architecture
Gateways connecting to trading exchanges
Making a trading system trade with exchanges
Examining the API for communication
Order book management
Order book considerations
Strategy making decisions on when to trade
The OMS
Critical components
Non-critical components
Command and control
Services
Summary
Chapter 3: Understanding the Trading Exchange Dynamics
Architecting a trading exchange for handling orders at a large scale
History of trading exchanges
Understanding features of an exchange
Exchange architecture
General order book and matching engine
Best price scenario
Partial fill scenario
No match scenario
Multiple orders with the same price
Summary
Part 2: How to Architect a High-Frequency Trading System
Chapter 4: HFT System Foundations โ From Hardware to OS
Understanding HFT computers
CPUs, from multi-processor to multi-core
Main memory or RAM
Shared memory
I/O devices
Using the OS for HFT systems
User space and kernel space
Process scheduling and CPU resource management
Memory management
Paged memory and page tables
System calls
Threading
Interruption management
The role of compilers
Executable file formats
Static versus dynamic linking
Summary
Chapter 5: Networking in Motion
Understanding networking in HFT systems
Learning about network conceptual models
Network communications between systems in HFT
Comprehending how switches work
Important protocol concepts
Using Ethernet for HFT communication
Using IPv4 as a network layer
UDP and TCP for the transport layer
Designing financial protocols for HFT exchanges
FIX protocol
Interior networks versus exterior networks
Understanding the packet life cycle
Comprehending the packet life in the send/receive (TX/RX) path
Software layer receiving the packet
Monitoring the network
Packet capture and analysis
Valuing time distribution
Time-synchronization services
Summary
Chapter 6: HFT Optimization โ Architecture and Operating System
Performance mental model
Understanding context switches ๏ฟผ
Types of context switches
Why are context switches good
Steps and operations involved in a context switch operation
Why are context switches bad for HFT?
Techniques to avoid or minimize context switches
Building lock-free data structures ๏ฟผ
When/why are locks needed (non-HFT applications)
Types of synchronization mechanisms
Problems and inefficiencies with using locks
Pre-fetching and pre-allocating memory
Memory hierarchy
Pre-fetching based alternatives to boost performance
Dynamic memory allocation
Pre-allocation-based alternatives to dynamic memory allocation
Summary
Chapter 7: HFT Optimization โ Logging, Performance, and Networking
Comparing kernel space and user space ๏ฟผ
What is kernel and user space?
Investigating performance โ kernel versus user space
Using kernel bypass
Understanding why kernel bypass is the alternative
Presenting kernel bypass latencies
Learning about memory-mapped files
Using cable fiber, hollow fiber, and microwave technologies ๏ฟผ
Evolution from cable fiber to hollow fiber to microwave
How hollow fiber works
How microwave works
Diving into logging and statistics
The need for logging in HFT
The need for online/live statistics computation in HFT
Measuring performance
Motivation for measuring performance
Linux tools for measuring performance
Custom techniques for measuring performance
Summary
Part 3: Implementation of a High-Frequency Trading System
Chapter 8: C++ โ The Quest for Microsecond Latency
C++ 14/17 memory model ๏ฟผ
What is a memory model?
The need for a memory model
The C++ 11 memory model and its rules
C++ memory model principles
Removing runtime decisions ๏ฟผ
Motivation for removing runtime decisions
Virtual functions
Performance penalties
Dynamic memory allocation ๏ฟผ
Runtime performance penalty
Using constexpr efficiently {ICON2}
Exceptions impeding performance {ICON2}
Templates reducing the runtime ๏ฟผ
What are templates?
Template specialization {ICON2}
Why use templates?
Disadvantages of templates
Performance of templates
Standard Template Library (STL)
Static analysis
What is C++ static analysis?
The need for static analysis
Types of static analysis
Steps in static analysis
Benefits and drawbacks of static analysis
Use case-Building an FX high-frequency trading system
Summary
Chapter 9: Java and JVM for Low-Latency Systems
Introducing the basics of Java
Reducing the impact of the GC ๏ฟผ
What to do to keep GC events low and fast
Warming up the JVM ๏ฟผ
Tiered compilation in JVM
Optimizing the JVM for better startup performance
Measuring the performance of a Java software
Why are Java microbenchmarks difficult to create?
Real-time performance measures
Java threading ๏ฟผ
Using a thread pool/queue with threads
High-performance task queue ๏ฟผ
Queues
Circular buffer
LMAX disruptor
Logging and DB access
External or internal thread?
Summary
Chapter 10: Python โ Interpreted but Open to High Performance
Introducing Python
Making use of Python for analytics
Why is Python slow?
How do we use libraries in Python?
Python and C++ for HFT
Using C++ in Python
Using Python with C++
Boost.Python library
Using ctypes/CFFI to accelerate Python code
SWIG
Improving the speed of Python code in HFT
Summary
Chapter 11: High-Frequency FPGA and Crypto
Reducing latencies with FPGA ๏ฟผ
Evolution of the fierce competition of speed in HFT
Introduction to FPGA
Diving into FPGA trading systems
Advantages of FPGA trading systems
Disadvantages of FPGA trading systems
Final words on FPGAs
Exploring HFT with cryptocurrencies
What is crypto?
How do crypto transactions work?
What is a blockchain?
What is cryptocurrency mining?
Similarities between traditional asset trading and cryptocurrency trading
Main differences between traditional asset trading and cryptocurrency trading
Trading with cryptocurrency exchange
HFT strategies in crypto
Building a high-frequency system for crypto trading
How to build a trading system in the cloud
Summary
Index
Other Books You May Enjoy
๐ SIMILAR VOLUMES
This is the survival guide for trading in a world where high-frequency trading predominates in markets, accounting for upwards of 60% of trading in equities and futures, and 40% in foreign exchange. High-frequency trading is the subject of extensive debate, particularly as to whether it is beneficia
A hands-on guide to high frequency trading strategies and models <p>Accounting for over sixty percent of stock market trading volume and generating huge profits for a small number of firms, high frequency trading is one of the most talked about topics in the world of finance. Given the success of t
A fully revised second edition of the best guide to high-frequency trading High-frequency trading is a difficult, but profitable, endeavor that can generate stable profits in various market conditions. But solid footing in both the theory and practice of this discipline are essential to success.