Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learn Algorithmic Trading

You're reading from   Learn Algorithmic Trading Build and deploy algorithmic trading systems and strategies using Python and advanced data analysis

Arrow left icon
Product type Paperback
Published in Nov 2019
Publisher Packt
ISBN-13 9781789348347
Length 394 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Sebastien Donadio Sebastien Donadio
Author Profile Icon Sebastien Donadio
Sebastien Donadio
Sourav Ghosh Sourav Ghosh
Author Profile Icon Sourav Ghosh
Sourav Ghosh
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Section 1: Introduction and Environment Setup FREE CHAPTER
2. Algorithmic Trading Fundamentals 3. Section 2: Trading Signal Generation and Strategies
4. Deciphering the Markets with Technical Analysis 5. Predicting the Markets with Basic Machine Learning 6. Section 3: Algorithmic Trading Strategies
7. Classical Trading Strategies Driven by Human Intuition 8. Sophisticated Algorithmic Strategies 9. Managing the Risk of Algorithmic Strategies 10. Section 4: Building a Trading System
11. Building a Trading System in Python 12. Connecting to Trading Exchanges 13. Creating a Backtester in Python 14. Section 5: Challenges in Algorithmic Trading
15. Adapting to Market Participants and Conditions 16. Other Books You May Enjoy

Making a risk management algorithm

By now, we're aware of the different types of risks and factors, including the risks in a trading strategy and the most common risk metrics for algorithmic trading strategies. Now, let's have a look at incorporating these risk measures into our volatility adjusted mean reversion trading strategy to make it safer before deploying it into live markets. We will set the risk limits to 150% of the maximum achieved historically. We are doing this because it is possible that there is a day in the future that is very different from what we've seen historically. Let's get started:

  1. Let's define our risk limits, which we are not allowed to breach. As we discussed previously, it will be set to 150% of the historically observed maximums:
# Risk limits
RISK_LIMIT_WEEKLY_STOP_LOSS = -12000 * 1.5
RISK_LIMIT_MONTHLY_STOP_LOSS = -14000...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime