C++ High Performance for Financial Systems 9781805124528

An in-depth guide covering system architecture, low-latency strategies, risk management, and machine learning for experi

154 97 13MB

English Pages 317 Year 2024

Report DMCA / Copyright

DOWNLOAD EPUB FILE

Table of contents :
C++ High Performance for Financial Systems
Contributors
About the author
About the reviewer
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Share Your Thoughts
Download a free PDF copy of this book
1
Introducing C++ in Finance and Trading
The historical context of C++ in finance and trading
The role of C++ and other languages in finance and trading
Skills required for finance and trading
The future of C++ in finance and trading
Popular applications of C++ in finance
Algorithmic trading platforms
HFT systems
Risk management software
Pricing engines
Market data infrastructure
The FIX protocol’s implementation
Data analytics
Order management systems
Quantitative analysis
Backtesting platforms
Machine learning applications
Challenges of using C++
Complexity and learning curve
Talent scarcity
Domain expertise
Legacy systems
Goals and objectives of the book
Help experienced developers get into the financial industry
Learn to build financial trading systems
Implement high-performance computing techniques
Understand machine learning for finance
Understanding the technical requirements for building high-performance financial trading systems
Summary
2
System Design and Architecture
Understanding the components of a financial trading system and their interdependence
Market data and feed handlers
OMSs
Execution and trade management systems
Models and strategies
Risk and compliance management systems
Monitoring systems
How should monitoring systems be implemented?
Conceptual architecture
Structural view of the architecture
Use cases
Activity diagrams
Sequence diagrams
Process view
Hardware considerations
Servers and CPUs
Networking and NICs
FPGAs
Graphics processing unit (GPUs)
Summary
3
High-Performance Computing in Financial Systems
Technical requirements
Implementing the LOB and choosing the right data structure
Multi-threading environments
Implementing data feeds
Implementing the Model and Strategy modules
Implementing the Messaging Hub module
Implementing OMS and EMS
Implementing RMS
Measuring system performance and scalability
Profiling
Key performance metrics
Scaling systems to manage increasing volumes of data
Scaling the messaging hub
Scaling the OMS
Scaling the RMS
Scaling the Limit Order Book (LOB)
Scaling the Strategies module
Summary
4
Machine Learning in Financial Systems
Technical requirements
Introduction to ML in trading
Types of ML algorithms and their mechanisms
The impact of big data and cloud computing
Integrating ML into HFT systems
ML for predictive analytics
Predicting price movements with ML
Predicting market trends and behaviors
ML for risk management systems
Stress testing and scenario analysis
Market risk assessment
Model risk management
Liquidity risk assessment
DPO
ML for order execution optimization
Why use ML for order execution optimization?
Deep diving into implementation – evolving an intelligent order router using DRL
Sample C++ code walkthrough
Challenges
Differences between training models with historical data (offline) and making predictions in real-time
Challenges in translating research findings into production-ready code
Limitations in ML based on our use case
Conclusions
Future trends and innovations
Quantum computing
Summary
5
Scalability in Financial Systems
Approaches for scaling financial trading systems
Scaling vertically versus horizontally
Data partitioning and load balancing
Implementing distributed systems
Best practices for achieving scalability
Designing for failure
Continuous operation
Building with flexibility and modularity in mind
Considering the impact of network and communication overhead
Understanding the trade-offs between performance, scalability, and cost
Balancing performance and scalability needs
Measuring and optimizing cost
Implementation example – Scaling our financial trading system for increased volume and complexity
Designing a horizontally scalable system
Measuring and monitoring system performance and scalability
Summary
6
Low-Latency Programming Strategies and Techniques
Technical requirements
Introduction to hardware and code execution
Understanding modern CPU architecture
Vector processing and Single Instruction, Multiple Data (SIMD)
CPU clock speed and overclocking
Understanding how the compiler translates C++ into machine code
Overview of hardware execution of code
Cache optimization techniques
Optimizing data structures for cache efficiency
Writing cache-friendly code
System warmup techniques
Understanding the importance of warmup in low-latency systems
Strategies for effective warmup – priming CPU and memory
Case studies – warmup routines in HFT
Minimizing kernel interaction
User space versus kernel space
Techniques to reduce system calls
Impact of context switching on performance
Branch prediction and its impact on performance
How branch prediction works
Writing branch-prediction-friendly code
Summary
7
Advanced Topics in Financial Systems
Quantum computing in finance
Quantum algorithms for option pricing and risk analysis
Implementation challenges and C++ integration
Future prospects of quantum computing in trading systems
Blockchain and cryptocurrencies
The basics of blockchain technology in financial systems
Smart contracts and DeFi
Challenges and opportunities in cryptocurrency trading
Advanced derivative pricing techniques
Cutting-edge models for pricing complex derivatives
Accelerating computations with parallel computing and GPUs
Algorithmic game theory in financial markets
Application of game theory in algorithmic trading
Strategic behavior and market efficiency
Nash equilibria in auction markets and their computational challenges
Summary
Conclusions
Index
Why subscribe?
Other Books You May Enjoy
Packt is searching for authors like you
Share Your Thoughts
ownload a free PDF copy of this book

C++ High Performance for Financial Systems
 9781805124528

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
Recommend Papers