Book Image

Getting Started with Forex Trading Using Python

By : Alex Krishtop
Book Image

Getting Started with Forex Trading Using Python

By: Alex Krishtop

Overview of this book

Algorithm-based trading is a popular choice for Python programmers due to its apparent simplicity. However, very few traders get the results they want, partly because they aren’t able to capture the complexity of the factors that influence the market. Getting Started with Forex Trading Using Python helps you understand the market and build an application that reaps desirable results. The book is a comprehensive guide to everything that is market-related: data, orders, trading venues, and risk. From the programming side, you’ll learn the general architecture of trading applications, systemic risk management, de-facto industry standards such as FIX protocol, and practical examples of using simple Python codes. You’ll gain an understanding of how to connect to data sources and brokers, implement trading logic, and perform realistic tests. Throughout the book, you’ll be encouraged to further study the intricacies of algo trading with the help of code snippets. By the end of this book, you’ll have a deep understanding of the fx market from the perspective of a professional trader. You’ll learn to retrieve market data, clean it, filter it, compress it into various formats, apply trading logic, emulate the execution of orders, and test the trading app before trading live.
Table of Contents (21 chapters)
1
Part 1: Introduction to FX Trading Strategy Development
5
Part 2: General Architecture of a Trading Application and A Detailed Study of Its Components
11
Part 3: Orders, Trading Strategies, and Their Performance
15
Part 4: Strategies, Performance Analysis, and Vistas

What this book covers

Chapter 1, Developing Trading Strategies – Why They Are Different, introduces the concept of trading strategies and automated trading and highlights the main components of a trading application, such as receiving market data, making trading decisions, and executing orders.

Chapter 2, Using Python for Trading Strategies, focuses on using Python for market analysis, modeling, and actual trading.

Chapter 3, FX Market Overview from a Developer’s Standpoint, explains how markets operate, focuses on the different kinds of market participants and the way they affect the price, and introduces core terminology essential for any further study.

Chapter 4, Trading Application – What’s Inside?, expands the first draft of a trading app architecture that was proposed in Chapter 1 and provides a more detailed view of its main components.

Chapter 5, Retrieving and Handling Market Data with Python, provides practical examples of manipulating ticks and order book data, explains the use of data compression, and introduces the concept of a universal data connector.

Chapter 6, Basics of Fundamental Analysis and Its Possible Use in FX Trading, explains the difference between fundamental and technical analysis and shows examples of the most important fundamental events and the way they impact the market price.

Chapter 7, Technical Analysis and Its Implementation in Python, considers a number of the most well-known and typical technical studies, explains their relationships with the underlying price time series, and suggests possible implementations in Python.

Chapter 8, Data Visualization in FX Trading with Python, introduces basic plotting, which is used to visualize price time series and other graphical objects, such as equity curves and drawdowns.

Chapter 9, Trading Strategies and Their Core Elements, introduces alpha and beta as the key performance metrics, explains benchmarking in capital management, and discusses the most popular alpha-generating trading strategies.

Chapter 10, Types of Orders and Their Simulation in Python, introduces the concept of a trading order, explains the main types of orders, and emphasizes the risks associated with each of them.

Chapter 11, Backtesting and Theoretical Performance, discusses backtesting as the core of any trading strategy development, reviews the architecture of a trading application, introduces multithreading and provides a detailed use case of it to organize communication between the parts of an app, explains the logic involved, and proposes working code solutions for a trading app using live market data for backtesting.

Chapter 12, Sample Strategy – Trend-Following, carefully considers all the steps necessary to develop a simple trading strategy from scratch and provides some working Python code.

Chapter 13, To Trade or Not to Trade – Performance Analysis, introduces the very basic metrics used to assess the performance of a trading strategy and gives practical examples using the theoretical performance of the strategy developed in Chapter 12.

Chapter 14, Where to Go Now?, offers a collection of trading ideas, technical setups, and code snippets that you can use for your own development.