
Introduction to the course. Learn what forward contracts are, and how they apply to crude oil.
The video focuses on the forward contract that Saudi Aramco signed with Sinopec.
The details of the contract are private so we are using example dates.
On the 1st of December 2025 , the two companies signed a forward contract on crude oil , where Saudi Aramco agreed to produce and sell 250 000 barrels of crude oil and ship it from Saudi Arabia to China, where Sinopec is. The delivery date will be months into the future i.e. 1st of September 2026.
Sinopec needs crude oil because it has refineries. These are facilities that use crude oil to produce diesel, jet fuel and other 'refined' products.
Siniopec needs crude oil therefore.
So they decided on the price of $77.5 / barrel.
Here is how they decided on this price:
a) They used machine learning to find a reasonable upper bound (maximum value) and lower bound on the spot crude oil price on the delivery date i.e. 1st of September 2026.
b) In between these two bounds, they assume possible values for the spot price of crude oil. For each value they calculate the PnL index (profit and loss).
PnL = (spot price - forward price)* quantity of crude oil.
So if spot price on delivery date is $60/barrel and forward price is $77.5 , then we find the spread (difference) and multiply it with the 250,000 barrels of crude oil agreed in the forward contract.
This is the PnL for the buyer (Sinopec) ,and it is negative (bad deal).
The whole process is described in this video.
This video explains how the forward contract objects are created in Python.
This video presents how we create the Trading Portfolio object , then add two oil forward contracts inside , and calculate the total notional value of the trading portfolio.
All these definitions are explained.
The video shows how to calculate the PnL metric (Profit and Loss) for oil forward contracts, as well as for the portfolio of these contracts.
Also the video explains what PnL is, and why Goldman Sachs calculates it.
This video shows how to calculate, in Python, the Value at Risk (VaR) risk measure for a portfolio of oil forward contracts.
The future spot price of crude oil is uncertain, which means there is some risk. This is quantified through VaR.
This video shows how to calculate the number of contracts in the portfolio, and how many of these contracts are unsettled. The concept of 'contract settlement' is explained in the video.
Also we calculate the notional utilisation of the portfolio. This shows how much of the notional limit of the portfolio is utilised by the notional value of all contracts.
All these are done in our Python model.
The video shows how the settlement of a forward contract works. The modelling is done in Python.
Settlement of a contract is when the oil is delivered from the seller to the buyer (of oil ) and the payment is completed (i.e. the buyer has paid the seller).
The forward contract has a delivery date on which the oil is shipped from the seller (of the oil) to the buyer (of the oil).
The video makes a revision of what we saw in chapter 2.
An oil forward contract is signed. On the delivery day the spot price is higher, and therefore the buyer PnL is positive.
We create the forward contract object, find the notional value, and find its PnL when it is settled on the delivery date.
This is all shown in Python.
The video shows how hedging works via forward contracts.
The company that sells crude oil signs a forward contract with a company that buys the crude oil.
On the delivery day (when the oil will be delivered from the seller to the buyer, according to the forward contract they signed) the spot price of crude oil drops. However, thanks to the forward contract, the seller has been protected.
The video shows how to conduct Price Scenario Analysis where for different values of the settlement price for the delivery day, we find the P&L of the forward contract.
Free access to my Community
WHO I AM: I hold a PhD in Quantitative Economics and Energy from Imperial College London. I teach practical, real-world data science specifically for the energy sector.
REGULAR ENHANCEMENTS: This course is reviewed periodically with updates to reflect the modern energy market.
STUDENT BONUS: Note: Students who enroll in this course will receive access to the Energy Data Scientist community.
What You'll Learn:
How forward contracts work and why companies use them to lock in oil prices months in advance
You'll create a complete forward contract modeling system from scratch, using the same professional architecture employed by trading desks at Goldman Sachs Commodities, J.P. Morgan, Morgan Stanley, and major oil trading houses like Vitol and Trafigura.
Calculate profit & loss (P&L) to see who wins and loses when oil prices change
Professional trading terminology used at investment banks: gross notional value, notional limits, and Value at Risk (VaR)
Build Python classes that separate pure calculations (functions) from state management (classes)
Track multiple contracts in a portfolio with position limits, exactly like Goldman Sachs and Shell trading desks
Understand the oil supply chain: producers, refineries, and how crude becomes gasoline
Learn how both investment banks and oil companies structure their commodity trading operations
Perfect For:
Python developers exploring trading careers at banks or energy companies
Finance students wanting hands-on coding experience for trading desk roles
Energy professionals understanding how investment banks trade commodities
Anyone curious about how Wall Street and Big Oil trade billions daily
Why This Matters:
The course includes detailed information about how actual trading desks operate at investment banks (Goldman Sachs Commodities, Morgan Stanley, J.P. Morgan) and integrated oil companies (Shell Trading, BP Trading, ExxonMobil). You'll learn about desk structure, team roles, Bloomberg terminals, and position limits used in the real world.
Most trading courses are either too theoretical (endless lectures) or too advanced (assumes finance background). This course finds the sweet spot: practical Python coding with real-world examples from both Wall Street and the energy sector, starting from the basics.
You'll use realistic company names, actual trading desk structures, and professional terminology – giving you a genuine taste of how commodity trading works at major investment banks and oil companies.