Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
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
Python for Algorithmic Trading Cookbook

You're reading from   Python for Algorithmic Trading Cookbook Recipes for designing, building, and deploying algorithmic trading strategies with Python

Arrow left icon
Product type Paperback
Published in Aug 2024
Publisher Packt
ISBN-13 9781835084700
Length 404 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Jason Strimpel Jason Strimpel
Author Profile Icon Jason Strimpel
Jason Strimpel
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Chapter 1: Acquire Free Financial Market Data with Cutting-Edge Python Libraries FREE CHAPTER 2. Chapter 2: Analyze and Transform Financial Market Data with pandas 3. Chapter 3: Visualize Financial Market Data with Matplotlib, Seaborn, and Plotly Dash 4. Chapter 4: Store Financial Market Data on Your Computer 5. Chapter 5: Build Alpha Factors for Stock Portfolios 6. Chapter 6: Vector-Based Backtesting with VectorBT 7. Chapter 7: Event-Based Backtesting Factor Portfolios with Zipline Reloaded 8. Chapter 8: Evaluate Factor Risk and Performance with Alphalens Reloaded 9. Chapter 9: Assess Backtest Risk and Performance Metrics with Pyfolio 10. Chapter 10: Set Up the Interactive Brokers Python API 11. Chapter 11: Manage Orders, Positions, and Portfolios with the IB API 12. Chapter 12: Deploy Strategies to a Live Environment 13. Chapter 13: Advanced Recipes for Market Data and Strategy Management 14. Index 15. Other Books You May Enjoy

Sending orders based on portfolio targets

We now have the components of our trading app built to add flexibility to the way we submit orders. By combining real-time position data and portfolio net liquidation value, we can build more sophisticated order techniques. For example, now that we can access current positions, we’re able to dynamically adjust our positions to align with quantity or value targets. Similarly, with live net liquidation value, we can calculate order sizes as a percentage of the portfolio. Building orders based on portfolio percentage targets unlocks advanced portfolio and risk management capabilities. This integration results in a more responsive trading system that is capable of adapting to market changes swiftly and executing orders that are consistently in tune with our overall risk management and investment objectives. In this recipe, we’ll implement methods to submit orders based on target values, quantities, and percentage allocations.

Getting...

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 $19.99/month. Cancel anytime