Option Greeks: Formulas, Python Code, and Charts

Options pricing is not about predicting direction. It is about quantifying multi-dimensional risk. The underlying price moves, time passes, volatility shifts, interest rates change, all simultaneously affecting an option’s value. Option Greeks extract the sensitivity of the option price to each of these variables, turning abstract risk into numbers you can hedge against. This is part one of a three-part series on option Greeks, covering the five first-order Greeks (Delta, Gamma, Theta, Vega, Rho) with their mathematical formulas, intuitive explanations, and Python implementations. Parts two and three will cover second-order Greeks and trading applications, respectively. ...

Posted on 2026-04-12 ·  In Quant ·  11 min read

TA-Lib Python Tutorial: The Complete Guide

TA-Lib is the most widely used technical analysis library in quantitative trading. 158 functions covering technical indicators and candlestick pattern recognition, all backed by a C implementation. If you do any kind of systematic trading in Python, you’ll run into it sooner or later. This tutorial covers everything from installation to a working strategy: the two API styles and when to use each, parameter selection tips for core indicators, candlestick pattern recognition, Pandas/Polars integration, and how TA-Lib compares to pandas-ta. If you’ve already set up yfinance for data, TA-Lib is the next step in turning that data into trading signals. ...

Posted on 2026-04-12 ·  In Quant ·  12 min read

The Complete Guide to Backtesting Pitfalls in Quantitative Trading

The backtest shows 80% annualized returns with a 5% max drawdown. Three months after going live, the strategy is down 30%. This scenario plays out repeatedly in quant trading, and the root cause is almost always the same: the backtest itself was wrong. Not a code bug — systematic flaws in the assumptions, data, and statistical methods that made the strategy look profitable when it wasn’t. This article breaks down the most common backtesting pitfalls into four categories: data pitfalls, statistical pitfalls, execution pitfalls, and psychological pitfalls. Each comes with a wrong-vs-right Python code comparison, followed by a self-check checklist. ...

Posted on 2026-04-10 ·  In Quant ·  13 min read

AlphaGPT: Mining Quantitative Factors with LLMs

One of the core tasks in quantitative investing is mining alpha factors — finding signals that predict asset returns. The traditional approach relies on researchers manually constructing factor expressions, or using automated search methods like Genetic Programming (GP) to brute-force combinations in the operator space. The former depends on human experience and intuition — low efficiency but high interpretability. The latter is efficient but produces deeply nested operator expressions that are nearly impossible for researchers to interpret. AlphaGPT (paper) brings large language models into the factor mining pipeline, using an LLM as the factor “generator.” The follow-up work, AlphaGPT 2.0 (paper), further introduces a human-in-the-loop closed cycle. ...

Posted on 2026-04-10 ·  In Quant ·  5 min read

A Complete Guide to Quantitative Trading Metrics

The worst part about quantitative trading isn’t having a bad strategy. It’s not knowing whether your strategy is good or bad. A strategy with 30% annualized returns sounds great, until you realize the max drawdown was 60% — you’d never have held through it. A Sharpe ratio of 2.0 looks impressive, but if it’s propped up by a few windfall trades in extreme market conditions, the Sortino ratio will tell a very different story. Quantitative trading metrics aren’t decorations for backtesting reports. They’re the tools that help you decide whether a strategy is worth putting real money behind. ...

Posted on 2026-04-10 ·  In Quant ·  7 min read

MEDUSA: Detailed Explanation of the Mechanism

MEDUSA is an acceleration framework designed to optimize the inference process for large language models (LLMs), specifically targeting the decoding phase in text generation tasks. Its core innovation lies in leveraging multiple decoding heads, which can simultaneously generate multiple candidate outputs, significantly reducing the time required for inference. Medusa: Simple LLM Inference Acceleration Framework with Multiple Decoding Heads Challenges in Traditional Decoding In conventional autoregressive decoding, the process typically involves the following steps: ...

Posted on 2025-01-03 ·  In NLP ·  4 min read

How to Use yfinance to Download Stock P/E Ratio

The Price-to-Earnings (P/E) ratio is a widely used financial metric that indicates how much investors are willing to pay for a dollar of earnings. Using Python’s yfinance library, you can easily download stock market data, including the P/E ratio. This blog will guide you step-by-step on how to retrieve the P/E ratio for stocks using yfinance. Step 1: Install and Import Required Libraries First, make sure you have yfinance installed. You can install it using pip if you haven’t already: ...

Posted on 2024-12-14 ·  In Quant ·  2 min read

A Tutorial to use yfinance

The yfinance Python library is a powerful tool for accessing financial data from Yahoo Finance. It allows users to download historical market data, fetch stock information, and analyze trends with minimal effort. In this tutorial, we will walk through the steps to install yfinance, retrieve stock data, and extract detailed stock information. 1. Installation To begin, ensure that yfinance is installed on your system: pip install yfinance 2. Downloading Historical Stock Data You can download historical stock prices using the yfinance.download method: ...

Posted on 2024-12-14 ·  In Quant ·  2 min read

How to Solve the Drive D Not Found Issue

Encountering the “Drive D: Not Found” error can be frustrating, especially when you rely on the drive for accessing critical data. This issue often occurs due to hardware malfunctions, incorrect system settings, or missing drive partitions. In this guide, we will walk you through the most effective troubleshooting steps to resolve the issue. 1. Verify Physical Connections The first step is to ensure that all hardware connections are secure: If Drive D: refers to an external hard drive or USB drive, check that the cables are properly connected and functional. Test the drive on another computer to confirm if it is recognized there. If not, the issue might be with the drive itself. For internal drives, ensure the SATA/IDE cables are securely attached inside the computer. 2. Check Disk Management Windows Disk Management can help identify if the drive is detected but not assigned a letter: ...

Posted on 2024-12-14 ·  In Misc ·  3 min read

How to Solve the Windows 11 RDP Black Screen Issue

If you’ve encountered the dreaded black screen when using Remote Desktop Protocol (RDP) on Windows 11, you’re not alone. This issue can be frustrating, especially if you rely on RDP for work or remote troubleshooting. This blog will guide you through the steps to fix this problem. Why Does the Black Screen Issue Occur? The black screen problem often arises due to incompatibilities or bugs introduced in updated NIC drivers. These drivers are critical for managing your network connections, and any conflict can disrupt services like RDP. Rolling back to a previous version of the NIC driver can resolve these compatibility issues. ...

Posted on 2024-12-14 ·  In Misc ·  2 min read