Options Trading System Programming Books
Version: 20 September 2026
Executive Summary
Section titled “Executive Summary”If you were to buy or read only one book, I would choose Yves Hilpisch’s Python for Finance, 2nd Edition. The reason is not that it goes deepest into options theory, but that among the six books considered, it comes closest to providing a complete learning path from research → pricing → risk → backtesting → automated execution. It starts with Python, NumPy, pandas, and numerical methods, then moves into stochastic processes, European and American options, Monte Carlo, Least-Squares Monte Carlo, derivatives portfolio valuation, and market calibration. It also covers algorithmic trading, vectorised backtesting, broker API order placement, capital and risk management, deployment, logging, and monitoring. O’Reilly classifies it as Beginner level; the second edition is 720 pages and was published in 2018. citeturn21view3
However, if your real focus is the options quantitative engine itself—for example implied volatility, volatility surfaces, Fourier/FFT methods, Heston, jump diffusion, calibration, and dynamic Delta hedging—rather than trading infrastructure, I would rate Derivatives Analytics with Python as the best specialist book combining theory with Python implementation. Wiley states that the book contains more than 5,000 lines of Python code and covers market data, risk-neutral valuation, Monte Carlo, model calibration, valuation, and dynamic hedging. Its chapters also go into Fourier pricing, American options, Heston and jump models, and hedging. citeturn8view0turn9view0turn9view2turn9view3
For Chinese-language material, the most relevant and complete title found in this research is the Simplified Chinese edition of Derivatives Analytics with Python, published by Publishing House of Electronics Industry in 2017 under the title Python Financial Derivatives Big Data Analysis: Modeling, Simulation, Calibration, and Hedging. It includes BSM, Greeks, CRR, implied volatility, EURO STOXX 50 volatility data, FFT, Merton, Longstaff-Schwartz, Heston, calibration, and dynamic hedging. However, the Taiwanese bookstore Tenlong currently lists this edition as out of print, so at present it may be easier to find through libraries or second-hand sellers, or to buy the English Wiley edition directly. citeturn8view3turn9view0turn9view2turn9view3
Another important conclusion is that I did not find a currently available Chinese- or English-language textbook that teaches option theory, volatility modelling, production-grade backtesting, options-specific execution, and live risk management in depth all in one volume. The most practical approach is to use Python for Finance as the main spine, then use Derivatives Analytics with Python to deepen your understanding of volatility and calibration. When you are ready to build a real event-driven options backtester or paper-execution system, add QuantLib or LEAN. QuantLib is positioned as a framework for modelling, trading, and risk management, with a C++ core and Python/R bindings; LEAN is an open-source algorithmic trading engine supporting research, backtesting, and live workflows. citeturn20search27turn22search3turn22search16
Final ranking:
- Best single book: Python for Finance, 2nd Edition
- Best for quantitative options depth: Derivatives Analytics with Python
- Best modern quantitative-finance supplement: Quantitative Finance with Case Studies in Python
- Best trading-infrastructure supplement: Python for Algorithmic Trading
- Best C++ pricing-engine architecture book: C++ Design Patterns and Derivatives Pricing
- Best more-modern C++ numerical-pricing reference: Financial Instrument Pricing Using C++
The strengths and weaknesses below are my assessment based on publisher tables of contents, author code repositories, publication dates, and their suitability for your goal of building an options trading system. They are not publisher ratings.
Core Book Comparison
Section titled “Core Book Comparison”| Book | Level and prerequisites | Language / libraries / frameworks | Implementation coverage | Strengths | Weaknesses | Edition / purchase |
|---|---|---|---|---|---|---|
| Python for Finance, 2nd Edition — Yves Hilpisch | Publisher level: Beginner; I would place it at beginner→intermediate. The publisher does not specify formal mathematical prerequisites. It contains introductory Python chapters, so you do not need to be a professional Python programmer first. | Python; NumPy, pandas, Numba, Cython; scikit-learn and TensorFlow in the ML sections; FXCM API; Jupyter/IPython workflow. | Binomial trees, Monte Carlo, European/American options, LSM, risk measures, derivatives portfolios, market calibration; plus trading strategies, vectorised backtesting, order placement, automated trading, leverage/risk, deployment, logging, and monitoring. citeturn21view3 | The most complete one-book path; it spans programming, derivatives, and trading infrastructure, making it the closest match for someone who wants to build a system. | Less depth on volatility surfaces and Heston calibration than DAWP; broker integration reflects a 2018 teaching environment, so in 2026 it is better treated as an architectural pattern and checked against current broker APIs. | 2nd ed., Dec 2018, 720 pp. citeturn21view3 Official O’Reilly page |
| Derivatives Analytics with Python — Yves Hilpisch | I would rate it Intermediate→Advanced. The publisher does not state a formal level or prerequisites. It is best if you already know Python, calculus, probability, and basic option concepts. | Python, IPython/Jupyter; official companion code. The author’s repository still contains code from older Python 3.6/2.7-era environments, so dependencies should be modernised when implementing today. citeturn5search0 | BSM/Greeks, CRR, implied volatility, volatility surfaces, Monte Carlo, American LSM, Fourier/FFT, Carr-Madan, Heston, jump diffusion, model calibration, dynamic hedging. citeturn8view0turn9view0turn9view2turn9view3 | The most options-centric of the six books; it goes directly from pricing into calibration, surfaces, and hedging, with substantial code. | It is not really a trading-system/execution textbook; backtesting, order management, and broker execution must be supplemented elsewhere. The original code environment is dated. | First published 5 Jun 2015. citeturn8view0 Wiley official page; author code |
| Quantitative Finance with Case Studies in Python — Chris Kelliher | Intermediate→Advanced / introductory graduate level; the publisher describes it as suitable for first-year master’s students in quantitative-finance-related programs. Formal prerequisites are not specified. citeturn22search12 | Python/Jupyter notebooks; the publisher/author provides a free code repository. The publisher page does not list a full package inventory, so other libraries are not specified. citeturn22search2turn22search27 | Options pricing, derivative pricing, portfolio management/optimization, hedging, risk, ML/AI; the new edition adds updated data science/AI, LLM, and SOFR material. citeturn22search5turn22search12 | The newest of the candidates; its case studies are closer to a modern quant workflow and it is a useful follow-on to Hilpisch’s 2018 book. | It is not a dedicated options-engine book; publisher materials do not indicate full treatment of an options-specific event-driven backtester, assignment, or broker execution. | The author’s code repository calls the newer book the 2nd edition; publication data shows 3 Dec 2025. citeturn22search2turn22search8 Taylor & Francis official page; new-edition code |
| Python for Algorithmic Trading — Yves Hilpisch | O’Reilly lists it as Intermediate–Advanced. Suitable if you already know basic Python and finance. citeturn8view1 | Python; NumPy, pandas, scikit-learn, TensorFlow; OANDA/FXCM APIs; real-time streaming and order interfaces. citeturn8view1 | SMA, momentum, mean reversion, vectorised backtesting, ML, real-time data, order placement, Kelly/leverage, risk, deployment, logging, and monitoring. citeturn8view1 | Of the six books, it is the most direct on backtest → live/paper execution → operations, making it an excellent complement to DAWP. | It is not an options-theory book: pricing, Greeks, IV surfaces, and Heston are not the focus, so I would not use it alone to learn options. | Nov 2020, 378 pp. citeturn8view1 O’Reilly official page; author code |
| C++ Design Patterns and Derivatives Pricing, 2nd Edition — Mark S. Joshi | Intermediate→Advanced. A Stevens course uses it as a textbook and expects basic C++ and mathematical finance, with the learning goal of implementing an object-oriented derivatives pricing model. citeturn10search17 | C++; emphasis on object-oriented design patterns and reusable pricing architecture. Third-party pricing libraries are not specified in the publisher information reviewed. | Derivatives-pricing software design, reusable payoff/pricing components, object-oriented pattern-driven engines; execution/backtesting is not the main focus. citeturn10search6turn10search17 | Excellent for learning how to turn option formulas into an extensible library and useful preparation for understanding QuantLib architecture. | The second edition is from 2008, before C++11. It is therefore more useful for abstraction/design principles than for copying modern C++ syntax and tooling directly. | 2nd ed., May 2008. citeturn10search6 Cambridge University Press official page |
| Financial Instrument Pricing Using C++, 2nd Edition — Daniel J. Duffy | Intermediate→Advanced; formal publisher prerequisites are not specified. Best suited to readers who already know C++ and basic quantitative finance. | C++ / C++11-era; templates and numerical finance. Detailed third-party library coverage is not specified. The author has noted that the second edition includes templates and Black-Scholes-related material. citeturn13search5 | Pricing-engine and numerical implementations, including Black-Scholes; the emphasis is financial-instrument pricing rather than end-to-end trade execution. | Better than Joshi if you want to go deeper into numerical C++ pricing engineering; Wiley publishes an official second edition. | A steeper learning curve for a Python-oriented researcher; options backtesting and live execution are not the main focus. | 2nd ed.; Wiley e-book Sep 2018, ISBN 978-1-119-17048-8. citeturn13search17 Wiley official page |
Chinese-Language Textbook Availability
Section titled “Chinese-Language Textbook Availability”The first Chinese-language title worth highlighting is the Simplified Chinese edition of Derivatives Analytics with Python, published as Python Financial Derivatives Big Data Analysis: Modeling, Simulation, Calibration, and Hedging. It is by Yves Hilpisch, was published by Publishing House of Electronics Industry on 2017-08-01, has ISBN-13 9787121313363, and runs to 321 pages. Its contents explicitly include BSM, Greeks, CRR, implied volatility, EURO STOXX 50, Lewis/Carr-Madan Fourier methods, FFT, Merton, American-option LSM, Heston/BCC97 calibration, and dynamic hedging. citeturn8view3turn9view0turn9view2turn9view3
For purchasing, Tenlong currently marks this edition as out of print. Publishing House of Electronics Industry is the original Chinese publisher, but this research did not find a currently active individual product page from the publisher where the book could still be ordered directly, so an official in-stock purchase channel is unconfirmed / not specified. citeturn8view3
Tenlong book page | Publishing House of Electronics Industry
In addition, QuantLib’s official documentation page explicitly lists a Chinese translation of Luigi Ballabio’s Implementing QuantLib, with the translator shown as “Xu Ruilong”. The same page also lists A QuantLib Guide and QuantLib Python Cookbook. The exact publication date and edition of the Chinese translation are not specified on that official page. For someone who already understands pricing theory and wants to study the internals of a production-style derivatives library, this is a valuable advanced supplement rather than a first introductory book. citeturn20search8
Best Single-Book Recommendation and Reading Strategy
Section titled “Best Single-Book Recommendation and Reading Strategy”I Would Choose Python for Finance, 2nd Edition
Section titled “I Would Choose Python for Finance, 2nd Edition”Your requirements actually contain two separate knowledge chains:
Options mathematics ↓Pricing → Greeks → IV → stochastic models → calibration → hedging
Trading system ↓Data → signals → backtest → portfolio/risk → execution → monitoringMost options books cover only the first chain; most algorithmic-trading books cover only the second. What makes Python for Finance unusual is that it covers both. Part IV includes trading platforms, APIs, historical/streaming data, orders, backtesting, automated trading, risk analysis, and deployment. Part V includes risk-neutral valuation, GBM/jump/square-root processes, European/American valuation, LSM, portfolio valuation, and options calibration. citeturn21view3
Therefore, if the goal is to have a working options research/paper-trading system after twelve weeks, it is a better spine textbook than a pure stochastic-calculus book. Conversely, if your career goal is sell-side derivatives quant, model validation, or volatility quant, I would reverse the order: start with Derivatives Analytics with Python, then move on to QuantLib/C++. That judgement follows directly from the way the two books divide the material: DAWP goes much deeper into Fourier methods, stochastic volatility, jump models, market calibration, and dynamic hedging, while Python for Finance has broader system coverage. citeturn8view0turn9view0turn9view2turn9view3turn21view3
The Most Practical Two-Book Combination
Section titled “The Most Practical Two-Book Combination”If you are not limited to one book, I would use:
Main spine: Python for Finance, 2nd Edition
Deep dive: Derivatives Analytics with Python / its Chinese translation
Then replace the older infrastructure code in the books with a modern stack:
NumPy / SciPy / pandas ↓Write your own Black-Scholes + Greeks + IV ↓Use QuantLib as an independent benchmark ↓Build your own event-driven backtester or use LEAN ↓Paper-broker adapter ↓Risk limits + monitoringQuantLib officially describes itself as a free/open-source framework for real-world quantitative-finance modelling, trading, and risk management. Its core is written in C++ and exposed through Python, R, and other bindings. LEAN provides research, backtesting, optimization, and live-trading workflows, and its documentation also includes Interactive Brokers live-trading integration. citeturn20search27turn22search6turn22search9
Original Papers and Open-Source Tools
Section titled “Original Papers and Open-Source Tools”I would not recommend memorising formulas from textbooks alone. When you implement a core algorithm, it is worth reading the original paper at least once, because that makes it easier to distinguish between model assumptions, numerical approximations, and the author’s software-design choices.
| Algorithm / model | Original source | What you should be able to implement |
|---|---|---|
| Black-Scholes | Fischer Black & Myron Scholes, The Pricing of Options and Corporate Liabilities, JPE 81(3), 1973, pp. 637–654; the University of Chicago Press page describes the valuation formula as being derived using a no-arbitrage portfolio principle. citeturn17search3turn17search6 Publisher/DOI | Price, Delta, Gamma, Vega; verify Greeks with finite differences; put-call parity tests. |
| CRR binomial tree | Cox, Ross & Rubinstein, Option Pricing: A Simplified Approach, JFE 7(3), Sep 1979, 229–263. citeturn19search10turn19search29 DOI | European + American call/put; convergence as tree steps increase; early-exercise boundary. |
| Heston stochastic volatility | Steven Heston, A Closed-Form Solution for Options with Stochastic Volatility…, RFS 6(2), 1993, 327–343. citeturn19search16 DOI | Characteristic-function pricer; parameter calibration; compare with the BSM implied-volatility smile. |
| Least-Squares Monte Carlo | Longstaff & Schwartz, Valuing American Options by Simulation: A Simple Least-Squares Approach, RFS 14(1), 2001, 113–147; the method estimates continuation value using least-squares regression. citeturn18search24turn18search4 DOI | American put; basis functions; compare pricing error with a CRR benchmark. |
| Carr-Madan FFT | Carr & Madan, Option Valuation Using the Fast Fourier Transform, Journal of Computational Finance 2(4), 1999; the paper uses characteristic functions and FFT for numerical option valuation. citeturn18search7 DOI | Price many strikes in one run; compare speed and error against direct integration / BSM benchmarks. |
Recommended Open-Source Stack
Section titled “Recommended Open-Source Stack”QuantLib should be your most important independent benchmark for correctness. Do not use it from day one as a replacement for writing BSM, trees, and LSM yourself. Write your own versions first, then cross-check them against QuantLib. Official documentation confirms that QuantLib is free/open-source, has a C++ core, and provides Python, R, and other bindings. citeturn20search27turn20search20
NumPy, SciPy, and pandas are appropriate foundations for numerical arrays, root-finding/optimization, and tabular option-chain data. The Python example below also uses SciPy to solve for implied volatility.
LEAN / QuantConnect LEAN GitHub is useful later for event-driven backtesting and paper/live execution. QuantConnect describes LEAN as the open-source algorithmic trading engine behind its platform, and the CLI documentation covers backtest, optimize, research, and live-brokerage workflows. citeturn22search3turn22search6turn22search16
Book code: DAWP author repository, Python for Algorithmic Trading repository, and Kelliher new-edition repository. The DAWP repository clearly preserves the book’s Python/Jupyter code, but it targets an older Python environment, so it is better to port the notebooks one by one into your own modern environment rather than pinning yourself to old dependencies. citeturn5search0turn3search9turn22search2
Learning-Project Roadmap
Section titled “Learning-Project Roadmap”For a twelve-week plan, I would not use “pages read” as the KPI. Instead, every week should produce at least one testable software artefact. The main path follows the NumPy/pandas, numerical methods, stochastic processes, algorithmic trading, derivatives valuation, portfolio valuation, and calibration material in Python for Finance, while volatility and Heston material can be supplemented with DAWP. citeturn21view3turn9view0turn9view2
flowchart LR A[Option-chain data] --> B["Validation & normalisation"] B --> C[BSM / CRR pricing] C --> D["Greeks & implied volatility"] D --> E[Volatility surface] E --> F[Heston / alternative model calibration] F --> G[Trading signal] G --> H["Portfolio & hedge engine"] H --> I[Event-driven backtest] I --> J["Risk limits & stress tests"] J --> K[Paper execution] K --> L["Monitoring & performance report"]| Week | Main work | Minimum deliverable |
|---|---|---|
| Week 1 | Create the repo, virtual environment, pytest setup, and data model; define OptionContract, Quote, Position, and Portfolio. Read the relevant Python/NumPy/pandas/OOP sections. | src/, tests/, notebook folder; a pipeline that can load and validate option-chain CSV/Parquet data. |
| Week 2 | Write Black-Scholes call/put pricing, put-call parity, and Delta/Gamma/Vega from scratch. | black_scholes.py + at least 20 unit tests; an error report comparing analytic Greeks with finite-difference Greeks. |
| Week 3 | Implement a CRR tree for European/American options; study convergence. | binomial.py; chart pricing error versus tree steps; American put early-exercise tests. |
| Week 4 | Implement an implied-volatility solver; clean and organise the option chain; build a strike×expiry IV grid. | implied_vol.py; IV + Greeks for every contract; explicit error flags for bad quotes and no-root cases. |
| Week 5 | Build a volatility-surface layer; start with interpolation, then add basic static-arbitrage sanity checks. | surface.py; surface heatmap; smile/skew chart by expiry; out-of-sample interpolation test. |
| Week 6 | Monte Carlo: GBM and antithetic sampling; then implement Longstaff-Schwartz for an American put. The original paper’s core idea is to regress continuation value. citeturn18search24 | monte_carlo.py, lsm.py; benchmark table comparing LSM and CRR pricing. |
| Week 7 | Implement a Heston characteristic-function pricer, or initially use QuantLib’s Heston engine as a reference; calibrate it to IV/price quotes. Heston’s original paper provides a stochastic-volatility closed-form framework. citeturn19search16 | heston.py; calibration objective, parameters, RMSE; model-vs-market smile chart. |
| Week 8 | Define a research-only strategy, such as a delta-hedged long/short volatility signal. Keep “signal” completely separate from “pricing”. | strategy.py; explicit entry/exit, rebalance, and expiry-selection rules; no future data allowed. |
| Week 9 | Build an event-driven backtester: quotes → signal → order → fill → positions → hedge → P&L. Include bid/ask, fees, slippage assumptions, and expiry lifecycle. | backtest/engine.py; trade ledger, daily P&L, and Greek-exposure history. |
| Week 10 | Build a risk engine: portfolio Delta/Gamma/Vega, position limits, scenario shocks, drawdown/kill-switch. Python for Finance itself covers risk measures, portfolio valuation, and capital/leverage/risk analysis. citeturn21view3 | risk.py; output Greeks + stress P&L at every timestamp; automatically reject new orders that breach limits. |
| Week 11 | Add a paper-execution abstraction. You can write your own Broker interface or port the system into LEAN; LEAN documentation covers backtest-to-live workflows and IB integration. citeturn22search9turn22search16 | PaperBroker; order states: submitted/partial/filled/cancelled/rejected; reconciliation test. |
| Week 12 | Run walk-forward/holdout tests; document all assumptions; compare BSM, surface, and Heston model error and strategy results; package the repo. | Complete README, architecture diagram, test coverage, research report, reproducible config, and paper-trading demo. |
What the Final Repository Should Look Like
Section titled “What the Final Repository Should Look Like”options-system/├── src/│ ├── instruments.py│ ├── black_scholes.py│ ├── binomial.py│ ├── implied_vol.py│ ├── surface.py│ ├── monte_carlo.py│ ├── lsm.py│ ├── heston.py│ ├── portfolio.py│ ├── risk.py│ ├── strategy.py│ ├── backtest/│ │ ├── engine.py│ │ ├── fills.py│ │ └── costs.py│ └── execution/│ ├── broker.py│ └── paper.py├── tests/├── notebooks/├── data/├── configs/└── README.mdThe most important design principle is to keep the pricing model, strategy, risk manager, and execution adapter separate. That way, in Week 7 you can replace Black-Scholes with Heston, or in Week 11 replace PaperBroker with a LEAN/IB adapter, without rewriting the entire strategy.
Python Implementation Example
Section titled “Python Implementation Example”The following code is enough to get started with Weeks 2–4: Black-Scholes pricing, the major Greeks, and implied-volatility inversion. The theoretical foundation of Black-Scholes comes from the 1973 paper, while both DAWP and Python for Finance use option valuation / BSM-style tools as the basis for later modelling. citeturn17search3turn9view0turn21view3
from __future__ import annotations
from dataclasses import dataclassfrom math import exp, log, sqrt
from scipy.optimize import brentqfrom scipy.stats import norm
@dataclass(frozen=True)class Greeks: delta: float gamma: float vega: float
def _d1_d2( spot: float, strike: float, maturity: float, rate: float, volatility: float, dividend_yield: float = 0.0,) -> tuple[float, float]: if spot <= 0 or strike <= 0: raise ValueError("spot and strike must be positive") if maturity <= 0: raise ValueError("maturity must be positive") if volatility <= 0: raise ValueError("volatility must be positive")
vol_sqrt_t = volatility * sqrt(maturity)
d1 = ( log(spot / strike) + (rate - dividend_yield + 0.5 * volatility**2) * maturity ) / vol_sqrt_t
d2 = d1 - vol_sqrt_t return d1, d2
def bs_price( spot: float, strike: float, maturity: float, rate: float, volatility: float, option_type: str, dividend_yield: float = 0.0,) -> float: """Black-Scholes-Merton price for a European call or put.""" d1, d2 = _d1_d2( spot, strike, maturity, rate, volatility, dividend_yield )
disc_q = exp(-dividend_yield * maturity) disc_r = exp(-rate * maturity)
if option_type == "call": return ( spot * disc_q * norm.cdf(d1) - strike * disc_r * norm.cdf(d2) )
if option_type == "put": return ( strike * disc_r * norm.cdf(-d2) - spot * disc_q * norm.cdf(-d1) )
raise ValueError("option_type must be 'call' or 'put'")
def bs_greeks( spot: float, strike: float, maturity: float, rate: float, volatility: float, option_type: str, dividend_yield: float = 0.0,) -> Greeks: d1, _ = _d1_d2( spot, strike, maturity, rate, volatility, dividend_yield )
disc_q = exp(-dividend_yield * maturity)
if option_type == "call": delta = disc_q * norm.cdf(d1) elif option_type == "put": delta = disc_q * (norm.cdf(d1) - 1.0) else: raise ValueError("option_type must be 'call' or 'put'")
gamma = ( disc_q * norm.pdf(d1) / (spot * volatility * sqrt(maturity)) )
# Vega here is change in option value per +1.00 change in volatility. # Divide by 100 for "per 1 volatility point". vega = spot * disc_q * norm.pdf(d1) * sqrt(maturity)
return Greeks(delta=delta, gamma=gamma, vega=vega)
def implied_volatility( market_price: float, spot: float, strike: float, maturity: float, rate: float, option_type: str, dividend_yield: float = 0.0, min_vol: float = 1e-6, max_vol: float = 5.0,) -> float: """Invert Black-Scholes price using a robust bracketed root solver.""" if market_price <= 0: raise ValueError("market_price must be positive")
def objective(vol: float) -> float: return bs_price( spot=spot, strike=strike, maturity=maturity, rate=rate, volatility=vol, option_type=option_type, dividend_yield=dividend_yield, ) - market_price
try: return brentq(objective, min_vol, max_vol) except ValueError as exc: raise ValueError( "No implied-volatility root found inside the chosen bracket. " "Check quote quality and no-arbitrage bounds." ) from exc
if __name__ == "__main__": s = 100.0 k = 105.0 t = 30 / 365 r = 0.04 sigma = 0.25
theoretical = bs_price(s, k, t, r, sigma, "call") recovered_iv = implied_volatility( theoretical, s, k, t, r, "call" ) greeks = bs_greeks(s, k, t, r, recovered_iv, "call")
print(f"Price: {theoretical:.4f}") print(f"Recovered IV: {recovered_iv:.6f}") print(greeks)The next step should not be to start writing a trading signal immediately. First, write tests:
def test_iv_round_trip(): sigma = 0.23
price = bs_price( spot=100, strike=100, maturity=0.5, rate=0.03, volatility=sigma, option_type="call", )
iv = implied_volatility( market_price=price, spot=100, strike=100, maturity=0.5, rate=0.03, option_type="call", )
assert abs(iv - sigma) < 1e-8By Weeks 8–10, the strategy/backtester interfaces should remain deliberately simple:
class Strategy: def on_market(self, snapshot, portfolio, models): """ Read-only market + model state. Return desired orders; do not mutate portfolio directly. """ return []
class RiskManager: def approve(self, order, portfolio, market): # Example policy: # reject if projected position/Delta/Gamma/Vega # exceeds configured limits. return True
class Broker: def submit(self, order): raise NotImplementedError
for timestamp, snapshot in market_stream:
models.update(snapshot) # IV, Greeks, surface, etc. desired_orders = strategy.on_market( snapshot, portfolio, models )
for order in desired_orders: if risk_manager.approve(order, portfolio, snapshot): broker.submit(order)
fills = broker.process(snapshot) portfolio.apply(fills) portfolio.mark_to_market(snapshot)
risk_log.write( timestamp=timestamp, delta=portfolio.delta(models), gamma=portfolio.gamma(models), vega=portfolio.vega(models), pnl=portfolio.pnl, )The biggest difference between this architecture and simply following textbook notebooks is that you deliberately turn pricing → model state → signal → risk → order → fill → portfolio accounting into clear system boundaries. By the final week, you should be able to regression-test your own BSM/CRR/LSM implementations against QuantLib, then run the same strategy interface inside either your own backtester or LEAN. QuantLib provides a pricing/risk framework, while LEAN’s official workflow can extend from research/backtesting to live brokerage execution, making the two natural engineering references for the later stages. citeturn20search27turn22search6turn22search9
Conclusion: If you want one book that covers the broadest path, buy Python for Finance, 2nd Edition. If you want to become genuinely strong in quantitative options, add Derivatives Analytics with Python. If you prefer reading in Chinese, look for the Publishing House of Electronics Industry translation of the latter, although new copies are currently harder to find. After completing the twelve-week project above, moving on to Joshi, Duffy, and QuantLib will be much more valuable—because at that point your problem will no longer be simply “how do I write the formula?”, but rather “how do I design a derivatives system that is testable, supports interchangeable models, can be backtested, enforces risk controls, and connects cleanly to execution?” citeturn21view3turn8view0turn8view3turn20search8