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

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