How to calculate RSI in Python: Wilder’s method on Apple stock
RSI in Python with Wilder’s smoothing on a year of Apple (AAPL) prices from Market Data, checked against a hand-written loop and the old rolling-mean version.
RSI in Python with Wilder’s smoothing on a year of Apple (AAPL) prices from Market Data, checked against a hand-written loop and the old rolling-mean version.
Beta neutrality is a powerful risk management strategy that can help protect your investments from broad market movements. In this article, I’ll walk you through how to analyze and neutralize the beta of a portfolio using Python, complete with code examples you can adapt for your own investments. What is Beta Neutrality? Beta neutrality is…
In our series on Python for finance, we’ve covered portfolio construction , risk management , backtesting , and optimization . Now, we’ll explore how to use Python to implement technical indicators, starting with moving averages. Disclaimer: This article was drafted with the assistance of artificial intelligence and reviewed by the editor prior to publication to ensure…
Python portfolio backtesting on real Alphabet (GOOGL) and T-bill prices from 2018 to 2026, checked against the filings: four rebalancing rules, drift and drawdowns compared.
Understanding how your portfolio moves with the market—or against it—is key to managing risk and return effectively. In this post, we’ll dive into two powerful metrics using Python: Beta, which measures your portfolio’s sensitivity to market movements, and Dollar Delta, which quantifies the dollar impact of those movements. We’ll also calculate portfolio volatility and market correlation for…
Risk management is the shield that protects your portfolio from unexpected losses. Whether it’s a sudden market dip or a prolonged downturn, understanding and quantifying risk is essential for any investor. In this post, we’ll explore three practical techniques—Value at Risk (VaR), Conditional VaR (CVaR), and stress testing—and bring them to life using Python with…
Portfolio theory is a powerful framework that helps investors balance risk and return by constructing optimal portfolios. In this second post in the series portfolio management with Python, we’ll dive into its core ideas—diversification, correlation, and the Efficient Frontier—building on the basics from Post 1. Using Python and real-world stock data from Apple (AAPL), Microsoft…
Portfolio management is a crucial skill for any investor, whether you’re managing your own savings or working in finance. At its core, portfolio management is about balancing risk and return to achieve your financial goals. With the rise of powerful tools like Python, even beginners can dive into this world and start analyzing real-world data…