Skip to content
Computations in Finance
Computational FinanceLecture 03Chapter 05Starts 1:11:11

Coding of Martingales in Python

A focused guide to this chapter from Option Pricing and Simulation in Python. Watch the teaching segment below or explore the concept before opening the video on YouTube.

Understanding Coding of Martingales in Python

The Python experiment explores how to recognize martingale behaviour in simulated paths. Rather than relying on a single trajectory, it uses numerical conditional expectations and repeated simulations to study whether expected future values agree with current values. This connects a mathematical definition to a computational diagnostic.

Why it matters in practice

An individual simulated martingale can rise steeply or fall sharply; neither movement contradicts the martingale property. What must be checked is the average behaviour conditional on available information. The exercise shows why Monte Carlo evidence needs sufficient samples and careful interpretation.

From the Computational Finance course

This topic is chapter 5 of Lecture 3: Option Pricing and Simulation in Python. Explore the lecture slides and code ↗. Subscribe on YouTube ↗.

← Back to the topic library · Lecture 3