This document describes pricing options using lattice models, specifically binomial trees. It provides details on:
1) Using a binomial tree to price a European call option by replicating the option payoff at each node.
2) Matching the moments of the binomial and Black-Scholes models to derive the Cox-Ross-Rubinstein (CRR) binomial tree.
3) Implementing the CRR model in C++ to price European call and put options via backward induction on the tree.
On building FX Volatility surface - The Vanna Volga methodQuasar Chunawala
The document discusses methods for constructing FX volatility surfaces, specifically the Vanna-Volga method. It begins by explaining the volatility smile seen in FX option markets and reasons for its existence. It then provides details on implementing the bisection method to find implied volatility. Next, it shows an example of plotting the volatility skew of NIFTY options. Finally, it provides the key equations for the Vanna-Volga method, including defining the strikes for ATM, 25 delta call and put, and deriving the expressions for vega, vanna, and volga of calls and puts.
Pricing Exotics using Change of NumeraireSwati Mital
The intention of this essay is to show how change of numeraire technique is used in pricing derivatives with complex payoffs. In the first instance, we apply the technique to pricing European Call Options and then use the same method to price an exotic Power Option.
Notes for Computational Finance lectures, Antoine Savine at Copenhagen Univer...Antoine Savine
The document discusses computational finance and machine learning in finance. It begins by noting the need for speed in pricing and hedging derivatives, as institutions must compute values and sensitivities rapidly to hedge risk before markets move. Traditional methods become impractical for complex transactions. The document then discusses various techniques to achieve faster computation, including Monte Carlo simulation, adjoint differentiation, leveraging hardware, and machine learning. Regulatory requirements like counterparty valuation adjustment (CVA) further increase computational demands. Overall, the document emphasizes that speed is critical in financial computation and an active area of research.
This document describes an uncertain volatility model for pricing equity option trading strategies when the volatilities are uncertain. It uses the Black-Scholes Barenblatt equation developed by Avellaneda et al. to derive price bounds. The model is implemented in C++ using recombining trinomial trees to discretize the asset prices over time and space. The code computes the upper and lower price bounds by solving the Black-Scholes Barenblatt PDE using numerical techniques, with the volatility set based on the sign of the option gamma.
http://www.options-trading-education.com/24043/straddle-options/
Straddle Options
When an options trader is not sure which way prices will go in a volatile market he or she often uses straddle options. Straddle options both long and short let a trader stake out potentially profitable positions for both rising and falling markets. Which route a trader takes in using straddle options will depend on whether he wants to buy or sell options contracts.
Going Long
A long straddle is buying both a call and a put on the same stock with the same expiration date. In a long straddle options strategy the worst a trader can do is lose the cost of the premiums paid for the call and the put if the stock does not change price. These straddle options have potentially unlimited potential if the stock price changes significantly, up or down.
Long Straddle Calls
If the stock price goes up the trader exercises the call option, sells the stock at the spot price and buys at the strike price. The profit is the price of 100 shares per contract at the spot price minus the strike price, minus the cost of premiums on both put and call options.
Long Straddle Puts
If the stock goes down in price the trader exercises the put option and sells the stock at the strike price and buys at the new, lower market price, the spot price. The profit will be the price of 100 shares per contract at the strike price minus the spot price minus the premium cost of both put and call options.
This strategy is useful in a volatile and unpredictable market. It carries twice the overhead of a call or put trade. But, the trader cuts down on the risk of missing out on an unexpected market move by covering both up and down eventualities. The only time when a trader loses with a long straddle is when the stock price does not change and then he is only out the cost of two options contracts.
Going Short
A short straddle strategy is selling both a put and a call on the same stock with the same options expiration dates. If the stock does not go up or down the options trader gains two premiums, one for the call and one for the put. Straddle options like these can be cash cows for a trader who has done his homework and only sells contracts on stocks that have very little likelihood of going up or down.
Volatile Markets and Big Losses
Whereas a long straddle is ideal for a volatile market a short straddle should only be used in a quiet market. As with all selling of options contracts the losses can be enormous if a stock price changes greatly. Which is why selling options contracts is so commonly limited to traders with very deep pockets.
Volatile Markets and Big Gains
Volatile markets bring us back to the long straddle. This is the ideal strategy for a market that is crazy in its volatility.
The document discusses several momentum indicators used in technical analysis:
1) The True Strength Index (TSI) uses exponential moving averages of momentum to indicate trend direction and overbought/oversold conditions. Values between +25 and -25 suggest the market may turn.
2) The Relative Strength Index (RSI) compares recent gains to recent losses to measure momentum. Values above 70 suggest an asset is overbought and below 30 means it is oversold.
3) The Stochastic Oscillator compares the current close to the high-low range to indicate if a stock is near the high or low end of its recent trading range.
4) The Williams %R reflects the
Slides for the Differential Machine Learning masterclass given by Brian Huge and Antoine Savine in Barcelona at the Quant Minds International event of December 2021.
This presentation summarises two years of research and development at Danske Bank on the pricing and risk of financial derivatives by machine learning and artificial intelligence.
The presentation develops the themes introduced in two articles in Risk Magazine, October 2020 and October 2021. Those themes are being further developed in the book Modern Computational Finance: Differential Machine Learning, with Chapman and Hall, autumn 2022.
Scalping futures is a technique which can provide a steady revenue stream to talented traders. This course explains the basics of the techniques involved in short term trading of index futures and what is involved in becoming a successful day trader.
On building FX Volatility surface - The Vanna Volga methodQuasar Chunawala
The document discusses methods for constructing FX volatility surfaces, specifically the Vanna-Volga method. It begins by explaining the volatility smile seen in FX option markets and reasons for its existence. It then provides details on implementing the bisection method to find implied volatility. Next, it shows an example of plotting the volatility skew of NIFTY options. Finally, it provides the key equations for the Vanna-Volga method, including defining the strikes for ATM, 25 delta call and put, and deriving the expressions for vega, vanna, and volga of calls and puts.
Pricing Exotics using Change of NumeraireSwati Mital
The intention of this essay is to show how change of numeraire technique is used in pricing derivatives with complex payoffs. In the first instance, we apply the technique to pricing European Call Options and then use the same method to price an exotic Power Option.
Notes for Computational Finance lectures, Antoine Savine at Copenhagen Univer...Antoine Savine
The document discusses computational finance and machine learning in finance. It begins by noting the need for speed in pricing and hedging derivatives, as institutions must compute values and sensitivities rapidly to hedge risk before markets move. Traditional methods become impractical for complex transactions. The document then discusses various techniques to achieve faster computation, including Monte Carlo simulation, adjoint differentiation, leveraging hardware, and machine learning. Regulatory requirements like counterparty valuation adjustment (CVA) further increase computational demands. Overall, the document emphasizes that speed is critical in financial computation and an active area of research.
This document describes an uncertain volatility model for pricing equity option trading strategies when the volatilities are uncertain. It uses the Black-Scholes Barenblatt equation developed by Avellaneda et al. to derive price bounds. The model is implemented in C++ using recombining trinomial trees to discretize the asset prices over time and space. The code computes the upper and lower price bounds by solving the Black-Scholes Barenblatt PDE using numerical techniques, with the volatility set based on the sign of the option gamma.
http://www.options-trading-education.com/24043/straddle-options/
Straddle Options
When an options trader is not sure which way prices will go in a volatile market he or she often uses straddle options. Straddle options both long and short let a trader stake out potentially profitable positions for both rising and falling markets. Which route a trader takes in using straddle options will depend on whether he wants to buy or sell options contracts.
Going Long
A long straddle is buying both a call and a put on the same stock with the same expiration date. In a long straddle options strategy the worst a trader can do is lose the cost of the premiums paid for the call and the put if the stock does not change price. These straddle options have potentially unlimited potential if the stock price changes significantly, up or down.
Long Straddle Calls
If the stock price goes up the trader exercises the call option, sells the stock at the spot price and buys at the strike price. The profit is the price of 100 shares per contract at the spot price minus the strike price, minus the cost of premiums on both put and call options.
Long Straddle Puts
If the stock goes down in price the trader exercises the put option and sells the stock at the strike price and buys at the new, lower market price, the spot price. The profit will be the price of 100 shares per contract at the strike price minus the spot price minus the premium cost of both put and call options.
This strategy is useful in a volatile and unpredictable market. It carries twice the overhead of a call or put trade. But, the trader cuts down on the risk of missing out on an unexpected market move by covering both up and down eventualities. The only time when a trader loses with a long straddle is when the stock price does not change and then he is only out the cost of two options contracts.
Going Short
A short straddle strategy is selling both a put and a call on the same stock with the same options expiration dates. If the stock does not go up or down the options trader gains two premiums, one for the call and one for the put. Straddle options like these can be cash cows for a trader who has done his homework and only sells contracts on stocks that have very little likelihood of going up or down.
Volatile Markets and Big Losses
Whereas a long straddle is ideal for a volatile market a short straddle should only be used in a quiet market. As with all selling of options contracts the losses can be enormous if a stock price changes greatly. Which is why selling options contracts is so commonly limited to traders with very deep pockets.
Volatile Markets and Big Gains
Volatile markets bring us back to the long straddle. This is the ideal strategy for a market that is crazy in its volatility.
The document discusses several momentum indicators used in technical analysis:
1) The True Strength Index (TSI) uses exponential moving averages of momentum to indicate trend direction and overbought/oversold conditions. Values between +25 and -25 suggest the market may turn.
2) The Relative Strength Index (RSI) compares recent gains to recent losses to measure momentum. Values above 70 suggest an asset is overbought and below 30 means it is oversold.
3) The Stochastic Oscillator compares the current close to the high-low range to indicate if a stock is near the high or low end of its recent trading range.
4) The Williams %R reflects the
Slides for the Differential Machine Learning masterclass given by Brian Huge and Antoine Savine in Barcelona at the Quant Minds International event of December 2021.
This presentation summarises two years of research and development at Danske Bank on the pricing and risk of financial derivatives by machine learning and artificial intelligence.
The presentation develops the themes introduced in two articles in Risk Magazine, October 2020 and October 2021. Those themes are being further developed in the book Modern Computational Finance: Differential Machine Learning, with Chapman and Hall, autumn 2022.
Scalping futures is a technique which can provide a steady revenue stream to talented traders. This course explains the basics of the techniques involved in short term trading of index futures and what is involved in becoming a successful day trader.
Forex Trading - How to Create a Trading Strategy | Different Candle Stick Pat...BlueMax Capital
Learn about the Forex Fundamental Analysis and the Major Economic Indicators ; Technical Analysis; Forex Charts; Types of Candlesticks; Trendline Analysis; Support and Resistance Strategy; Technical Indicators; Forex Strategy; Risk Management and much more
“Forex Trading Strategies” is a complete guide of most popular and widely used strategies in Forex trade. You can read about day trading and its main types, understand the strategies based on market analysis, learn about portfolio and algorithmic trading, and many more. The book represents the ins and outs of each strategy - why and how it is used and how to get profit from trade. It is suitable for all traders who are novice in trade or want to improve their skills. All the strategies classified and explained here are for educational purposes and can be applied by each trader in a different way.
This document summarizes a lecture on discrete structures. It discusses logical equivalences, De Morgan's laws, tautologies and contradictions. It also covers laws of logic like distribution, identity and negation. Conditional propositions are defined as relating two propositions with "if-then". Truth tables are used to check logical equivalence and interpret conditionals. The contrapositive and biconditional are also introduced.
What are some of the advantages of using a scalping strategy to trade the forex market? - Quick profits Entry and exit is usually done within a couple of minutes. This allows for quick profits but can lead to quick losses as well. - Exit is usually within 20 minutes or less - Lots of trades Strategy uses 3 Indicators The strategy uses 3 indicators: pivot points, Fibonacci retracement and the Stochastic Oscillator. The 3 main pivot points both above and below the pivot are used for this system: S1, S2, S3 and R1, R2, R3. The Fibonacci retracement values used are the 0.618, the 0.382 and the 0.500 levels. The Stochastic Oscillator is set at 5,3,3.
This document provides an overview of 6LoWPAN (IPv6 over Low Power Wireless Personal Area Networks). It discusses key topics such as introduction, related technologies, applications, architecture, protocol stack, link layers, addressing, forwarding and routing, header compression, fragmentation and reassembly, networking issues, security, mobility, application protocols, and implementing 6LoWPAN on single and dual chip systems. The document serves as a technical reference for 6LoWPAN specifications, components, and implementation considerations.
This document provides an introduction to Fibonacci trading. It explains that Fibonacci tools can help traders enter and exit trades earlier than traditional trend following methods based on lagging indicators. The Fibonacci sequence is introduced, along with key ratios like 38.2%, 50%, and 61.8% that are used to identify retracement levels. The document aims to teach readers how to incorporate Fibonacci analysis into their trading strategy to take advantage of its predictive, leading indicator properties.
BlackBull Markets - Enjoy the benefits of licensed Regulated Brokerage with our White Label solution. BlackBull Markets offers institutional grade best Forex white label program and technologies.
The Data Distribution Service (DDS) is a standard for efficient and ubiquitous data sharing built upon the concept of a, strongly typed, distributed data space. The ability to scale from resource constrained embedded systems to ultra-large scale distributed systems, has made DDS the technology of choice for applications, such as, Power Generation, Large Scale SCADA, Air Traffic Control and Management, Smart Cities, Smart Grids, Vehicles, Medical Devices, Simulation, Aerospace, Defense and Financial Trading.
This two part webcast provides an in depth introduction to DDS – the universal data sharing technology. Specifically, we will introduce (1) the DDS conceptual model and data-centric design, (2) DDS data modeling fundamentals, (3) the complete set of C++ and Java API, (4) the most important programming, data modeling and QoS Idioms, and (5) the integration between DDS and web applications.
After attending this webcast you will understand how to exploit DDS architectural features when designing your next system, how to write idiomatic DDS applications in C++ and Java and what are the fundamental patterns that you should adopt in your applications.
The document discusses candlestick patterns and how to interpret them. It explains that candlesticks show the battle between buyers and sellers over a period of time. Bullish candlesticks indicate an upward trend and buying pressure, while bearish candlesticks signal a downward trend and selling pressure. It provides examples of common bullish formations like bullish engulfing and morning star, and bearish formations such as bearish engulfing and evening star. The document encourages attending a workshop to see these patterns in live markets.
The DDS specification provides fine-grained control over the real-time behaviour, dependability, and performance of DDS applications by means of a rich set of QoS Policies. The challenge for many DDS users is that the specifications explains very clearly how each QoS allows to control very specific aspects of data distribution yet it provides no hints on how different QoS should be composed to control complex properties such as the consistency model, or to impose end-to-end real-time scheduling decision. This half-day tutorial will fill this gap by providing attendees with (1) an explanation of how the various QoS compose, and (2) providing attendees with a series of QoS-composition Patters that can be used to control macro-properties of an application, such as the consistency model.
RTSP is used for controlling streaming media over the web. It allows for audio and video-on-demand streaming to large groups. RTSP uses directives like OPTIONS, DESCRIBE, SETUP, PLAY, PAUSE, and TEARDOWN to control the stream. SDP is used to describe the metadata of the stream, including information like the session name, connection details, media formats, and attributes. Common RTSP operations include requesting information with OPTIONS, retrieving the SDP description with DESCRIBE, setting up transports with SETUP, starting and pausing playback with PLAY and PAUSE, and terminating the session with TEARDOWN.
1) Understanding the Black-Sholes Model
2) Understanding Option Greeks (Delta, Gamma, Theta & Vega)
3) How to Apply Option Greeks Practically
4) How to use Options Greek Calculator
Option Hydra 2.0 is a 95+ hours of online mentorship program for option traders who want to learn market profile for short term and very short term trading.
For more details about the course visit: http://optionhydra.com
Looking for best intraday trading rules? Platinum Trading Systems presents simple, easy & golden rules for Intraday trading. Get This 7 Rules and Earn More Money in Intraday.
- The document outlines a BSc research project on pricing financial derivatives using the Black-Scholes model.
- The project aims to learn established financial models, compare pricing techniques, and see how newer models relate to existing ones.
- It provides background on the student's motivation and experience, and introduces key concepts like options, the Black-Scholes equation, and its derivation and solution.
- The student will present their work on applying and extending the Black-Scholes model to price derivatives.
This document provides an overview of Lesson 2 which covers Itô's lemma and the Black-Scholes model. It first discusses the log-normal property of stock prices and how Itô's lemma can be used to derive the geometric Brownian motion process. It then introduces the Black-Scholes model, its assumptions, and the partial differential equation it yields. Finally, it presents the Black-Scholes formulas for European call and put options and defines the Greeks (Delta, Gamma, Vega, Theta, Rho) as sensitivities in the Black-Scholes model.
The document provides an overview of option valuation using the binomial model. It describes a multi-period binomial model where the underlying stock price can move up or down by a factor u or d at each period. The value of a call option is calculated as the expected discounted payoff over the periods. Key steps include: (1) Setting parameters u, d, p to match the stock's expected return, variance over each period, and a simplifying condition; (2) Using risk-neutral valuation to price options assuming stock returns the risk-free rate; (3) Applying the one-period model recursively to value options over multiple periods.
1. The document discusses the pricing of variance swaps using risk neutral valuation. It defines variance swaps as transactions where the payout is based on the difference between realized variance and a prespecified strike variance.
2. It derives a formula for the strike variance that is equal to the risk-neutral expected value of the average variance over the swap period, where the expectation is calculated using Black-Scholes option pricing.
3. The value of a variance swap is defined as the notional amount multiplied by the difference between realized variance, estimated from historical stock prices, and the strike variance estimated from option prices. The variance swap thus specifies the value of differences between two estimates of the true variance.
1. The document discusses the pricing of variance swaps using risk neutral valuation. It defines variance swaps as transactions where the payout is based on the difference between realized variance and a prespecified strike variance.
2. It derives a formula for the strike variance that equates it to the risk-neutral expected value of the integrated variance process over the swap period, where the expectation is calculated using Black-Scholes option prices.
3. The document explains that variance swaps allow parties to hedge differences between estimates of ex-ante variance derived from option prices and ex-post variance calculated from realized stock returns over the swap period.
The document summarizes key aspects of the Black-Scholes model for pricing options. It discusses:
1) How the Black-Scholes model can be derived as the limiting case of the binomial model as the number of time periods approaches infinity.
2) How the Black-Scholes formula provides the same intuition as the binomial model, with the stock price weighted by the hedge ratio and strike price weighted by probability of being in-the-money.
3) Important properties of the Black-Scholes formulas, such as how they relate to forward contracts in the limits of high/low stock prices, approach a maximum value as volatility approaches zero, and can be interpreted using risk-
The comparative study of finite difference method and monte carlo method for ...Alexander Decker
This document compares the finite difference method and Monte Carlo method for pricing European options. The finite difference method solves the Black-Scholes partial differential equation by approximating it on a grid, while the Monte Carlo method simulates asset price paths and averages discounted payoffs. The study finds that while both methods agree with the Black-Scholes price, the finite difference method converges faster and is more accurate for standard European options, whereas Monte Carlo is better suited for exotic options due to its flexibility.
11.the comparative study of finite difference method and monte carlo method f...Alexander Decker
This document compares the finite difference method and Monte Carlo method for pricing European options. It provides an overview of these two primary numerical methods used in financial modeling. The Monte Carlo method simulates asset price paths and averages discounted payoffs to estimate option value. It is well-suited for path-dependent options but converges slower than finite difference. The finite difference method solves the Black-Scholes PDE by approximating it on a grid. Specifically, it discusses the Crank-Nicolson scheme, which is unconditionally stable and converges faster than Monte Carlo for standard options.
Forex Trading - How to Create a Trading Strategy | Different Candle Stick Pat...BlueMax Capital
Learn about the Forex Fundamental Analysis and the Major Economic Indicators ; Technical Analysis; Forex Charts; Types of Candlesticks; Trendline Analysis; Support and Resistance Strategy; Technical Indicators; Forex Strategy; Risk Management and much more
“Forex Trading Strategies” is a complete guide of most popular and widely used strategies in Forex trade. You can read about day trading and its main types, understand the strategies based on market analysis, learn about portfolio and algorithmic trading, and many more. The book represents the ins and outs of each strategy - why and how it is used and how to get profit from trade. It is suitable for all traders who are novice in trade or want to improve their skills. All the strategies classified and explained here are for educational purposes and can be applied by each trader in a different way.
This document summarizes a lecture on discrete structures. It discusses logical equivalences, De Morgan's laws, tautologies and contradictions. It also covers laws of logic like distribution, identity and negation. Conditional propositions are defined as relating two propositions with "if-then". Truth tables are used to check logical equivalence and interpret conditionals. The contrapositive and biconditional are also introduced.
What are some of the advantages of using a scalping strategy to trade the forex market? - Quick profits Entry and exit is usually done within a couple of minutes. This allows for quick profits but can lead to quick losses as well. - Exit is usually within 20 minutes or less - Lots of trades Strategy uses 3 Indicators The strategy uses 3 indicators: pivot points, Fibonacci retracement and the Stochastic Oscillator. The 3 main pivot points both above and below the pivot are used for this system: S1, S2, S3 and R1, R2, R3. The Fibonacci retracement values used are the 0.618, the 0.382 and the 0.500 levels. The Stochastic Oscillator is set at 5,3,3.
This document provides an overview of 6LoWPAN (IPv6 over Low Power Wireless Personal Area Networks). It discusses key topics such as introduction, related technologies, applications, architecture, protocol stack, link layers, addressing, forwarding and routing, header compression, fragmentation and reassembly, networking issues, security, mobility, application protocols, and implementing 6LoWPAN on single and dual chip systems. The document serves as a technical reference for 6LoWPAN specifications, components, and implementation considerations.
This document provides an introduction to Fibonacci trading. It explains that Fibonacci tools can help traders enter and exit trades earlier than traditional trend following methods based on lagging indicators. The Fibonacci sequence is introduced, along with key ratios like 38.2%, 50%, and 61.8% that are used to identify retracement levels. The document aims to teach readers how to incorporate Fibonacci analysis into their trading strategy to take advantage of its predictive, leading indicator properties.
BlackBull Markets - Enjoy the benefits of licensed Regulated Brokerage with our White Label solution. BlackBull Markets offers institutional grade best Forex white label program and technologies.
The Data Distribution Service (DDS) is a standard for efficient and ubiquitous data sharing built upon the concept of a, strongly typed, distributed data space. The ability to scale from resource constrained embedded systems to ultra-large scale distributed systems, has made DDS the technology of choice for applications, such as, Power Generation, Large Scale SCADA, Air Traffic Control and Management, Smart Cities, Smart Grids, Vehicles, Medical Devices, Simulation, Aerospace, Defense and Financial Trading.
This two part webcast provides an in depth introduction to DDS – the universal data sharing technology. Specifically, we will introduce (1) the DDS conceptual model and data-centric design, (2) DDS data modeling fundamentals, (3) the complete set of C++ and Java API, (4) the most important programming, data modeling and QoS Idioms, and (5) the integration between DDS and web applications.
After attending this webcast you will understand how to exploit DDS architectural features when designing your next system, how to write idiomatic DDS applications in C++ and Java and what are the fundamental patterns that you should adopt in your applications.
The document discusses candlestick patterns and how to interpret them. It explains that candlesticks show the battle between buyers and sellers over a period of time. Bullish candlesticks indicate an upward trend and buying pressure, while bearish candlesticks signal a downward trend and selling pressure. It provides examples of common bullish formations like bullish engulfing and morning star, and bearish formations such as bearish engulfing and evening star. The document encourages attending a workshop to see these patterns in live markets.
The DDS specification provides fine-grained control over the real-time behaviour, dependability, and performance of DDS applications by means of a rich set of QoS Policies. The challenge for many DDS users is that the specifications explains very clearly how each QoS allows to control very specific aspects of data distribution yet it provides no hints on how different QoS should be composed to control complex properties such as the consistency model, or to impose end-to-end real-time scheduling decision. This half-day tutorial will fill this gap by providing attendees with (1) an explanation of how the various QoS compose, and (2) providing attendees with a series of QoS-composition Patters that can be used to control macro-properties of an application, such as the consistency model.
RTSP is used for controlling streaming media over the web. It allows for audio and video-on-demand streaming to large groups. RTSP uses directives like OPTIONS, DESCRIBE, SETUP, PLAY, PAUSE, and TEARDOWN to control the stream. SDP is used to describe the metadata of the stream, including information like the session name, connection details, media formats, and attributes. Common RTSP operations include requesting information with OPTIONS, retrieving the SDP description with DESCRIBE, setting up transports with SETUP, starting and pausing playback with PLAY and PAUSE, and terminating the session with TEARDOWN.
1) Understanding the Black-Sholes Model
2) Understanding Option Greeks (Delta, Gamma, Theta & Vega)
3) How to Apply Option Greeks Practically
4) How to use Options Greek Calculator
Option Hydra 2.0 is a 95+ hours of online mentorship program for option traders who want to learn market profile for short term and very short term trading.
For more details about the course visit: http://optionhydra.com
Looking for best intraday trading rules? Platinum Trading Systems presents simple, easy & golden rules for Intraday trading. Get This 7 Rules and Earn More Money in Intraday.
- The document outlines a BSc research project on pricing financial derivatives using the Black-Scholes model.
- The project aims to learn established financial models, compare pricing techniques, and see how newer models relate to existing ones.
- It provides background on the student's motivation and experience, and introduces key concepts like options, the Black-Scholes equation, and its derivation and solution.
- The student will present their work on applying and extending the Black-Scholes model to price derivatives.
This document provides an overview of Lesson 2 which covers Itô's lemma and the Black-Scholes model. It first discusses the log-normal property of stock prices and how Itô's lemma can be used to derive the geometric Brownian motion process. It then introduces the Black-Scholes model, its assumptions, and the partial differential equation it yields. Finally, it presents the Black-Scholes formulas for European call and put options and defines the Greeks (Delta, Gamma, Vega, Theta, Rho) as sensitivities in the Black-Scholes model.
The document provides an overview of option valuation using the binomial model. It describes a multi-period binomial model where the underlying stock price can move up or down by a factor u or d at each period. The value of a call option is calculated as the expected discounted payoff over the periods. Key steps include: (1) Setting parameters u, d, p to match the stock's expected return, variance over each period, and a simplifying condition; (2) Using risk-neutral valuation to price options assuming stock returns the risk-free rate; (3) Applying the one-period model recursively to value options over multiple periods.
1. The document discusses the pricing of variance swaps using risk neutral valuation. It defines variance swaps as transactions where the payout is based on the difference between realized variance and a prespecified strike variance.
2. It derives a formula for the strike variance that is equal to the risk-neutral expected value of the average variance over the swap period, where the expectation is calculated using Black-Scholes option pricing.
3. The value of a variance swap is defined as the notional amount multiplied by the difference between realized variance, estimated from historical stock prices, and the strike variance estimated from option prices. The variance swap thus specifies the value of differences between two estimates of the true variance.
1. The document discusses the pricing of variance swaps using risk neutral valuation. It defines variance swaps as transactions where the payout is based on the difference between realized variance and a prespecified strike variance.
2. It derives a formula for the strike variance that equates it to the risk-neutral expected value of the integrated variance process over the swap period, where the expectation is calculated using Black-Scholes option prices.
3. The document explains that variance swaps allow parties to hedge differences between estimates of ex-ante variance derived from option prices and ex-post variance calculated from realized stock returns over the swap period.
The document summarizes key aspects of the Black-Scholes model for pricing options. It discusses:
1) How the Black-Scholes model can be derived as the limiting case of the binomial model as the number of time periods approaches infinity.
2) How the Black-Scholes formula provides the same intuition as the binomial model, with the stock price weighted by the hedge ratio and strike price weighted by probability of being in-the-money.
3) Important properties of the Black-Scholes formulas, such as how they relate to forward contracts in the limits of high/low stock prices, approach a maximum value as volatility approaches zero, and can be interpreted using risk-
The comparative study of finite difference method and monte carlo method for ...Alexander Decker
This document compares the finite difference method and Monte Carlo method for pricing European options. The finite difference method solves the Black-Scholes partial differential equation by approximating it on a grid, while the Monte Carlo method simulates asset price paths and averages discounted payoffs. The study finds that while both methods agree with the Black-Scholes price, the finite difference method converges faster and is more accurate for standard European options, whereas Monte Carlo is better suited for exotic options due to its flexibility.
11.the comparative study of finite difference method and monte carlo method f...Alexander Decker
This document compares the finite difference method and Monte Carlo method for pricing European options. It provides an overview of these two primary numerical methods used in financial modeling. The Monte Carlo method simulates asset price paths and averages discounted payoffs to estimate option value. It is well-suited for path-dependent options but converges slower than finite difference. The finite difference method solves the Black-Scholes PDE by approximating it on a grid. Specifically, it discusses the Crank-Nicolson scheme, which is unconditionally stable and converges faster than Monte Carlo for standard options.
A new derivation of the Black Scholes Equation (BSE) based on integral form stochastic calculus is presented. Construction of the BSE solution is based on infinitesimal perfect hedging. The perfect hedging on a finite time interval is a separate problem that does not change option pricing. The cost of hedging does not present an adjustment of the BS pricing. We discuss a more profound alternative approach to option pricing. It defines option price as a settlement between counterparties and in contrast to BS approach presents the market risk of the option premium.
Derivatives pricing and Malliavin CalculusHugo Delatte
1. The document discusses using Malliavin calculus to compute Greeks, which measure the sensitivity of derivative prices to changes in variables like the underlying asset price. Malliavin calculus can improve the convergence speed for computing Greeks compared to finite difference methods, especially for options with discontinuous payoffs.
2. Traditional approaches to computing Greeks include using binomial trees or the Black-Scholes PDE. Finite difference methods introduce errors from both the Monte Carlo simulation and the derivative approximation. Malliavin calculus avoids differentiating the discontinuous payoff function.
3. The document provides an overview of Malliavin calculus, including the Malliavin derivative operator and integration by parts formula. It then compares
Notes I made in June 2013 on the derivation and use of the Black-Scholes equation. If you can forgive the terseness, you can look forward to some nifty stochastic partial differential equation twirling!
Any and all corrections are welcome!
The document discusses option pricing models. It covers the Binomial model and the Black-Scholes model. The Black-Scholes model assumes the stock price follows a geometric Brownian motion and uses a partial differential equation to derive a closed-form solution for pricing European stock options. It requires parameters such as the stock price, exercise price, risk-free interest rate, time to maturity, and volatility. The model provides a theoretical fair value for options.
Options pricing ( calculation of option premium)Ameya Ranadive
The document discusses various pricing models for options including:
1. Upper and lower bounds for call option value based on the stock price.
2. Factors that determine option value such as exercise price, expiration date, stock price, stock price variability, and interest rate.
3. The binomial model and risk-neutral valuation method for pricing options using a single period binomial tree framework.
4. The Black-Scholes model for pricing European options using a continuous time framework based on the stock's lognormal distribution.
5. Assumptions of the Black-Scholes model and adjustments needed for dividends, short-term options, and long-term options.
The Black-Scholes-Merton model prices options using the assumption that stock price changes are lognormally distributed. It derives the Black-Scholes differential equation by constructing a riskless portfolio of stock and options and requiring its value to earn the risk-free rate of return. The model uses risk-neutral valuation, which assumes the expected return on the stock is the risk-free rate, to calculate the expected payoff of the option. Discounting this expected payoff at the risk-free rate gives the option price. The model provides closed-form formulas for European call and put option prices in terms of the stock price, strike price, risk-free rate, time to maturity, and volatility.
The convenience yield implied by quadratic volatility smiles presentation [...yigalbt
This document discusses the implied convenience yield from quadratic volatility smiles in options. It presents formulas to calculate the implied convenience yield for illiquid options based on using liquid at-the-money options as hedging instruments. The formulas depend on observable market parameters like volatility and are meant to provide a simple way to compute the implied convenience yield without historical data assumptions. However, the model relies on several undefined expressions and economic assumptions that are not fully clear.
The document provides an overview of option valuation and pricing models. It discusses intrinsic value, put-call parity, and binomial and Black-Scholes option pricing models. The binomial model uses a tree approach to allow stock prices to move up or down over multiple periods to expiration. The Black-Scholes model provides a closed-form solution and values options based on stock price, strike price, volatility, time to expiration, and risk-free rate. An example applies the Black-Scholes formula to compute prices for a call and put option.
The document summarizes how asset price returns are modeled using stochastic processes. It defines the return as the change in price divided by the original price, which is better than using absolute change. The return has two parts: a predictable drift term and a random diffusion term represented by the Wiener process. Ito's lemma relates changes in functions of random variables to the variables themselves. Applying Ito's lemma to the value of an option V(S,t) leads to the Black-Scholes partial differential equation.
This document discusses the construction of riskless derivatives portfolios as proposed by Black and Scholes. It summarizes Black and Scholes' approach and then argues that their portfolio is not truly riskless, as it takes on risk at each discrete time interval. Specifically, the portfolio requires reconstruction at each time point to eliminate risk, and in the limit of infinitesimally small time intervals, the portfolio retains risk at all times. The document makes a similar argument against the claim that portfolios of multiple derivatives can be constructed to be riskless.
In this paper we show how the ambiguities in derivation of the BSE can be eliminated.
We pay attention to option as a hedging instrument and present definition of the option price based on market risk weighting. In such approach we define random market price for each market scenario. The spot price then is interpreted as a one that reflect balance between profit-loss expectations of the market participants
This document discusses issues with the derivation of the Black-Scholes equation and option pricing model. It highlights two popular derivations of the Black-Scholes equation, noting ambiguities in the original derivation. It proposes defining the hedged portfolio over a variable time interval to address these ambiguities. The document also notes drawbacks of the Black-Scholes price, including that it only guarantees a risk-free return over an infinitesimal time period and does not reflect market prices which may incorporate other strategies.
Similar to Options pricing using Lattice models (20)
Quasar Chunawala is seeking a position as a quantitative modeller. He has a Bachelor's degree in Mathematics and Information Technology. His self-learning projects include implementing a cubic spline interpolation algorithm in Python and summarizing the Vanna-Volga method for pricing FX implied volatility smiles. Currently, he works as a Quantitative Analyst at Credit Suisse, where he performs quantitative analysis tasks related to rates and credit derivatives.
The document discusses the benefits of exercise for mental health. Regular physical activity can help reduce anxiety and depression and improve mood and cognitive functioning. Exercise boosts blood flow and levels of neurotransmitters and endorphins which elevate and stabilize mood.
The document discusses the benefits of exercise for mental health. Regular physical activity can help reduce anxiety and depression and improve mood and cognitive function. Exercise causes chemical changes in the brain that may help protect against mental illness and improve symptoms.
This document describes an algorithm to compute the nth Fibonacci number using recursive squaring in better than linear time. It does this by raising the matrix ((1,1),(1,0)) to the nth power using recursive squaring. If n is even, it recursively computes An/2 and multiplies it by itself. If n is odd, it recursively computes A(n-1)/2 and multiplies it by itself and the original matrix A. This allows it to compute An in O(log n) time rather than the naive O(n) linear time approach. Pseudocode and a C++ implementation are provided.
The document discusses the benefits of exercise for mental health. Regular physical activity can help reduce anxiety and depression and improve mood and cognitive function. Exercise stimulates the production of endorphins in the brain which elevate mood and reduce stress levels.
This document provides notes on vector spaces, which are fundamental objects in linear algebra. It begins with examples of vector spaces such as R2, R3, C2, C3 and defines vector spaces more generally as sets that are closed under vector addition and scalar multiplication and satisfy other properties like the existence of additive identities. It then provides several examples of vector spaces including the set of all n-tuples over a field, the set of all m×n matrices, the set of differentiable functions on an interval, and the set of polynomials with coefficients in a field.
Interpolation techniques - Background and implementationQuasar Chunawala
This document discusses interpolation techniques, specifically Lagrange interpolation. It begins by introducing the problem of interpolation - given values of an unknown function f(x) at discrete points, finding a simple function that approximates f(x).
It then discusses using Taylor series polynomials for interpolation when the function value and its derivatives are known at a point. The error in interpolation approximations is also examined.
The main part discusses Lagrange interpolation - given data points (xi, f(xi)), there exists a unique interpolating polynomial Pn(x) of degree N that passes through all the points. This is proved using the non-zero Vandermonde determinant. Lagrange's interpolating polynomial is then introduced as a solution.
The technology uses reclaimed CO₂ as the dyeing medium in a closed loop process. When pressurized, CO₂ becomes supercritical (SC-CO₂). In this state CO₂ has a very high solvent power, allowing the dye to dissolve easily.
Or: Beyond linear.
Abstract: Equivariant neural networks are neural networks that incorporate symmetries. The nonlinear activation functions in these networks result in interesting nonlinear equivariant maps between simple representations, and motivate the key player of this talk: piecewise linear representation theory.
Disclaimer: No one is perfect, so please mind that there might be mistakes and typos.
dtubbenhauer@gmail.com
Corrected slides: dtubbenhauer.com/talks.html
ESPP presentation to EU Waste Water Network, 4th June 2024 “EU policies driving nutrient removal and recycling
and the revised UWWTD (Urban Waste Water Treatment Directive)”
The use of Nauplii and metanauplii artemia in aquaculture (brine shrimp).pptxMAGOTI ERNEST
Although Artemia has been known to man for centuries, its use as a food for the culture of larval organisms apparently began only in the 1930s, when several investigators found that it made an excellent food for newly hatched fish larvae (Litvinenko et al., 2023). As aquaculture developed in the 1960s and ‘70s, the use of Artemia also became more widespread, due both to its convenience and to its nutritional value for larval organisms (Arenas-Pardo et al., 2024). The fact that Artemia dormant cysts can be stored for long periods in cans, and then used as an off-the-shelf food requiring only 24 h of incubation makes them the most convenient, least labor-intensive, live food available for aquaculture (Sorgeloos & Roubach, 2021). The nutritional value of Artemia, especially for marine organisms, is not constant, but varies both geographically and temporally. During the last decade, however, both the causes of Artemia nutritional variability and methods to improve poorquality Artemia have been identified (Loufi et al., 2024).
Brine shrimp (Artemia spp.) are used in marine aquaculture worldwide. Annually, more than 2,000 metric tons of dry cysts are used for cultivation of fish, crustacean, and shellfish larva. Brine shrimp are important to aquaculture because newly hatched brine shrimp nauplii (larvae) provide a food source for many fish fry (Mozanzadeh et al., 2021). Culture and harvesting of brine shrimp eggs represents another aspect of the aquaculture industry. Nauplii and metanauplii of Artemia, commonly known as brine shrimp, play a crucial role in aquaculture due to their nutritional value and suitability as live feed for many aquatic species, particularly in larval stages (Sorgeloos & Roubach, 2021).
The binding of cosmological structures by massless topological defectsSérgio Sacani
Assuming spherical symmetry and weak field, it is shown that if one solves the Poisson equation or the Einstein field
equations sourced by a topological defect, i.e. a singularity of a very specific form, the result is a localized gravitational
field capable of driving flat rotation (i.e. Keplerian circular orbits at a constant speed for all radii) of test masses on a thin
spherical shell without any underlying mass. Moreover, a large-scale structure which exploits this solution by assembling
concentrically a number of such topological defects can establish a flat stellar or galactic rotation curve, and can also deflect
light in the same manner as an equipotential (isothermal) sphere. Thus, the need for dark matter or modified gravity theory is
mitigated, at least in part.
PPT on Direct Seeded Rice presented at the three-day 'Training and Validation Workshop on Modules of Climate Smart Agriculture (CSA) Technologies in South Asia' workshop on April 22, 2024.
Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...AbdullaAlAsif1
The pygmy halfbeak Dermogenys colletei, is known for its viviparous nature, this presents an intriguing case of relatively low fecundity, raising questions about potential compensatory reproductive strategies employed by this species. Our study delves into the examination of fecundity and the Gonadosomatic Index (GSI) in the Pygmy Halfbeak, D. colletei (Meisner, 2001), an intriguing viviparous fish indigenous to Sarawak, Borneo. We hypothesize that the Pygmy halfbeak, D. colletei, may exhibit unique reproductive adaptations to offset its low fecundity, thus enhancing its survival and fitness. To address this, we conducted a comprehensive study utilizing 28 mature female specimens of D. colletei, carefully measuring fecundity and GSI to shed light on the reproductive adaptations of this species. Our findings reveal that D. colletei indeed exhibits low fecundity, with a mean of 16.76 ± 2.01, and a mean GSI of 12.83 ± 1.27, providing crucial insights into the reproductive mechanisms at play in this species. These results underscore the existence of unique reproductive strategies in D. colletei, enabling its adaptation and persistence in Borneo's diverse aquatic ecosystems, and call for further ecological research to elucidate these mechanisms. This study lends to a better understanding of viviparous fish in Borneo and contributes to the broader field of aquatic ecology, enhancing our knowledge of species adaptations to unique ecological challenges.
The cost of acquiring information by natural selectionCarl Bergstrom
This is a short talk that I gave at the Banff International Research Station workshop on Modeling and Theory in Population Biology. The idea is to try to understand how the burden of natural selection relates to the amount of information that selection puts into the genome.
It's based on the first part of this research paper:
The cost of information acquisition by natural selection
Ryan Seamus McGee, Olivia Kosterlitz, Artem Kaznatcheev, Benjamin Kerr, Carl T. Bergstrom
bioRxiv 2022.07.02.498577; doi: https://doi.org/10.1101/2022.07.02.498577
Immersive Learning That Works: Research Grounding and Paths ForwardLeonel Morgado
We will metaverse into the essence of immersive learning, into its three dimensions and conceptual models. This approach encompasses elements from teaching methodologies to social involvement, through organizational concerns and technologies. Challenging the perception of learning as knowledge transfer, we introduce a 'Uses, Practices & Strategies' model operationalized by the 'Immersive Learning Brain' and ‘Immersion Cube’ frameworks. This approach offers a comprehensive guide through the intricacies of immersive educational experiences and spotlighting research frontiers, along the immersion dimensions of system, narrative, and agency. Our discourse extends to stakeholders beyond the academic sphere, addressing the interests of technologists, instructional designers, and policymakers. We span various contexts, from formal education to organizational transformation to the new horizon of an AI-pervasive society. This keynote aims to unite the iLRN community in a collaborative journey towards a future where immersive learning research and practice coalesce, paving the way for innovative educational research and practice landscapes.
ESR spectroscopy in liquid food and beverages.pptxPRIYANKA PATEL
With increasing population, people need to rely on packaged food stuffs. Packaging of food materials requires the preservation of food. There are various methods for the treatment of food to preserve them and irradiation treatment of food is one of them. It is the most common and the most harmless method for the food preservation as it does not alter the necessary micronutrients of food materials. Although irradiated food doesn’t cause any harm to the human health but still the quality assessment of food is required to provide consumers with necessary information about the food. ESR spectroscopy is the most sophisticated way to investigate the quality of the food and the free radicals induced during the processing of the food. ESR spin trapping technique is useful for the detection of highly unstable radicals in the food. The antioxidant capability of liquid food and beverages in mainly performed by spin trapping technique.
ESA/ACT Science Coffee: Diego Blas - Gravitational wave detection with orbita...Advanced-Concepts-Team
Presentation in the Science Coffee of the Advanced Concepts Team of the European Space Agency on the 07.06.2024.
Speaker: Diego Blas (IFAE/ICREA)
Title: Gravitational wave detection with orbital motion of Moon and artificial
Abstract:
In this talk I will describe some recent ideas to find gravitational waves from supermassive black holes or of primordial origin by studying their secular effect on the orbital motion of the Moon or satellites that are laser ranged.
1. Options pricing using Lattice models • October 2019 • with C++ code snippets
Options pricing
using Lattice models in C++
QUASAR CHUNAWALA
quasar.chunawala@gmail.com
October 2019
Abstract
This is a short essay on using lattice methods to price European and American style
options.
1. BINOMIAL TREES
1.1. Introduction.
Binomial trees are useful for pricing a variety of European and American-style derivatives.
The primary practical use of the Binomial model was and still is for pricing American-style
options.
1.2. Pricing a European call option on a binomial tree.
Consider a stock with initial price S0, which follows a binomial process. During a time
period ∆t, the price per share of this stock will be one of two possible values, it can go up
to S0u or down to S0d. Consider a European call option that confers on its owner the right,
but not the obligation to buy one share of stock at time one for the strike price K. The
European call option pays (St − K)+
at time t.
We assume that the markets are complete. In a complete market, every derivative
security can be replicated by trading in the stock and money market asset.
Suppose we begin with an initial wealth X0 and buy ∆ shares of a stock at price S0 at
time zero, leaving us with a cash postion X0 − ∆S0. The value of our portfolio of stock and
the money market account at time one is :
X1 = ∆S1 + er∆t
(X0 − ∆S0) = X0er∆t
+ ∆(S1 − S0er∆t
)
We want to find X0 and ∆ so, that X1(u) = Cu and X1(d) = Cd. Note here, that Cu and
Cd are given quantities, the amounts that the derivative security will pay off depending
upon the outcome of the coin tosses. At time zero, we know what the two values Cu and
Cd are; we don’t know which of these two possibilities will be realized. Replication of the
derivative security thus requires that :
1
2. Options pricing using Lattice models • October 2019 • with C++ code snippets
Figure 1: A binomial tree with N=4 timesteps
e−r∆t
Cu = X0 + ∆(S0ue−r∆t
− S0)
e−r∆t
Cd = X0 + ∆(S0de−r∆t
− S0)
One way to solve these two equations in two unknowns is to multiply the first by a
number ˜p and the second by ˜q = 1 − ˜p and then add them to get
e−r∆t
(˜pCu + ˜qCd) = X0 + ∆((˜pS0u + ˜qS0d)e−r∆t
− S0)
If we choose ˜p so that the ∆ term in the above equation is zero, that is :
S0 = e−r∆t
(˜pS0u + ˜qS0d)
we obtain the simple formula for X0,
X0 = e−r∆t
(˜pCu + ˜qCd)
We can solve for ˜p and ˜q as follows:
S0 = e−r∆t
(˜pS0u + ˜qS0d)
er∆t
= (˜pu + (1 − ˜p)d)
er∆t
= ˜p(u − d) + d
˜p =
er∆t
− d
u − d
˜q =
u − er∆t
u − d
2
3. Options pricing using Lattice models • October 2019 • with C++ code snippets
We can solve for ∆ simply by subtracting the portfolio values at time one -
∆ =
Cu − Cd
S0u − S0d
Thus, we have replicated the option payoff.
The numbers ˜p and ˜q are both positive because of the no-arbitrage condition and they
sum to one. For this reason, we can regard them as up and down probabilities. They are
not the actual probabilities, which I shall p and q, but rather the risk-neutral probabilities.
Under the actual probabilities, the average rate of growth of a stock is typically strictly
greater than the rate of growth of an investment in the money market; otherwise no one
would want to incur the risk associated with investing in the stock. Thus, p and q = 1 − p
should satisfy
S0 < e−r∆t
(pS0u + qS0d)
whereas ˜p and ˜q satisfy
S0 = e−r∆t
(˜pS0u + ˜qS0d)
If the average rate of growth of the stock were exactly the same as the rate of growth
of the money market investment, then investors must be neutral about risk - they do
not require compensation for assuming it, nor are they willing to pay extra for it. This
is simply not the case, and hence ˜p and ˜q cannot be the actual probabilities. They are
only numbers which assist us in the solution of the two equations in the two unknowns
(∆, X0). They assist us by making the term multiplying the unknown ∆ drop out. If we
want to construct a portfolio whose value at time one is V1, then its value at time zero,
must be given by the formula above, so that its mean rate of growth under risk-neutral
probabilities is the rate of growth of the money market investment. The formula is called
the risk-neutral pricing formula.
1.3. Matching moments of the binomial and lognormal distributions.
Consider a time period ∆t in the continuous time Black Scholes world. Suppose the stock
price process governed by following SDE :
dS = mSdt + σSdz
where m and σ are known constants - the mean rate of growth of the stock and the
volatility of the stock price respectively. The simplest choice is a constant volatility.
From Ito’s formula, we know that, if S(t) is any stochastic process, then the process
f(S(t), t) is given by the expansion :
df =
∂f
∂t
+ mS
∂f
∂S
+
1
2
σ2
S2 ∂2
f
∂S2
dt + σS
∂f
∂S
dz
If we let f(S) = log S then we obtain the following Wiener process :
3
4. Options pricing using Lattice models • October 2019 • with C++ code snippets
∂f
∂t
= 0
∂f
∂S
=
1
S
∂2
f
∂S2
= −
1
S2
=⇒ d(ln S) = (m −
1
2
σ2
)dt + σdz
=⇒ ln(
ST
S0
) = (m −
1
2
σ2
)T + σZ(0, T)
=⇒ ST = S0 exp[(m − σ2
/2)T + σ
√
TZ(0, 1)]
Thus, log ST is normally distributed.
log ST ∼ N(log S0 + (m − σ2
/2)T, σT)
We can now calculate the moments of the lognormal distribution around 0. We need
to calculate the mean and variance. Since, log ST is normally distributed, we can use the
moment generating function of the normal distribution to help calculate expections.
The MGF of a normal random variable Z is given by,
E(etZ
) =
+∞
−∞
etz 1
√
2π
e−z2
/2
dz
= et2
/2 1
√
2π
+∞
−∞
e−(z−t)2
/2
dz
= et2
/2
The MGF of X = ν + σZ by completing the square as above is MX(t) = eνt+σ2
t2
/2
. Let
the random variable Y = eX
= eν+σZ
. Then E(Y n
) = E(enX
) = eνn+σ2
n2
/2
.
Therefore, in particular,
E[ST ] = S0e(ν+σ2
/2)∆t
= S0e(m−σ2
/2+σ2
/2)∆t
= S0em∆t
E[S2
T ] = S0e(2ν+2σ2
)∆t
= S0e(2m−σ2
+2σ2
)∆t
= S0e(2m+σ2
)∆t
For the underlying price at the end of the period to have the same mean and variance
in both the binomial model and the Black Scholes models, the following two identities
must hold where the first and second moments are matched.
4
5. Options pricing using Lattice models • October 2019 • with C++ code snippets
pu + (1 − p)d = er∆t
pu2
+ (1 − p)d2
= e(2r+σ2
)∆t
Solving the first equation for the probability p, we obtain :
p =
er∆t
− d
u − d
1.4. CRR Binomial Tree.
Cox, Ross, Rubinstein in their original model assume the identity ud = 1, so that u = 1/d.
Substituting u = 1/d and the value of the risk neutral probability p into the second
equation we get :
p(u2
− d2
) + d2
= e(2r+σ2
)∆t
(er∆t
− d)(u + d) + d2
= e(2r+σ2
)∆t
er∆t
(u + d) − du − d2
+ d2
= e(2r+σ2
)∆t
er∆t
(u + d) − du = e(2r+σ2
)∆t
er∆t
(d2
+ 1) − d = e(2r+σ2
)∆t
d
(d2
+ 1) − d(e−r∆t
+ e(r+σ2
)∆t
) = 0
d2
− 2Ad + 1 = 0
where A = 1
2 (e−r∆t
+ e(r+σ2
)∆t
).
The solutions of this quadratic equation are:
u = A + A2 − 1
d = A − A2 − 1
If we linearize the above solution using the series expansion ex
= 1 + x + x2
2! + . . ., we
obtain -
A =
1
2
[(1 − r∆t) + (1 + r∆t + σ2
∆t)]
= 1 +
1
2
σ2
∆t
A2
=
1
4
[(1 − 2r∆t) + (1 + 2r∆t + 2σ2
∆t) + 2(1 + σ2
∆t)]
= 1 + σ2
∆t
u = 1 + σ
√
∆t +
1
2
σ2
∆t
d = 1 − σ
√
∆t +
1
2
σ2
∆t
5
6. Options pricing using Lattice models • October 2019 • with C++ code snippets
Terms of higher orders can be added without violating the relations since they become
infinitesimally small as ∆t approached 0. Thus, the more common form is
u = eσ
√
∆t
d = e−σ
√
∆t
The CRR has traditionally been the most widely used version of the binomial model.
[1]
1.5. CRR Binomial Tree implementation.
The following is an implementation of the CRR model on a European option.
#include<iostream>
#include <iostream>
#include <array>
class CRRBinomialTree
{
private:
double p;
std::array<std::array<double, 200>, 200> S;
std::array<std::array<double, 200>, 200> C;
double u;
double d;
double T;
int N;
double sigma;
double dt;
double r;
double s_0;
double K;
char optionType;
double q;
public:
CRRBinomialTree(double vol, double expiry, int numOfTimeSteps,
double spot, double strike, double rate, double div, char optType);
double pv();
double payOff(double s_t);
};
// CRRBinomialTree.cpp : Computes the value of a European
// option using backwards induction in a CRR Binomial tree
#include<iostream>
#include "CRRBinomialTree.h"
#include<cmath>
CRRBinomialTree::CRRBinomialTree(double vol, double expiry, int numOfTimeSteps,
6
7. Options pricing using Lattice models • October 2019 • with C++ code snippets
double spot, double strike, double rate, double div, char optType)
{
N = numOfTimeSteps;
T = expiry;
dt = T / N;
r = rate;
q = div;
sigma = vol;
u = exp(sigma * sqrt(dt));
d = 1 / u;
double a = exp((r - q) * dt);
p = (a - d) / (u - d);
s_0 = spot;
K = strike;
optionType = optType;
S = {0.0};
C = {0.0};
//compute the stock prices at each node
//initialize call prices
for (int i = 0; i <= N; ++i)
{
for (int j = 0; j <= i; ++j)
{
S[i][j] = s_0 * pow(u, j) * pow(d, i - j);
C[i][j] = 0.0;
}
}
}
double CRRBinomialTree::payOff(double S_t)
{
if (optionType == 'C')
return std::max(S_t - K, 0.0);
if (optionType == 'P')
return std::max(K - S_t, 0.0);
}
double CRRBinomialTree::pv()
{
double df = 0.0;
//compute terminal payoffs
for (int j = N; j >= 0; --j)
{
C[N][j] = payOff(S[N][j]);
}
//work backwards
7
8. Options pricing using Lattice models • October 2019 • with C++ code snippets
for (int i = N - 1; i >= 0; --i)
{
for (int j = i; j >= 0; --j)
{
df = exp(-r * dt);
C[i][j] = df * (p * C[i + 1][j + 1] + (1 - p) * C[i + 1][j]);
}
}
return C[0][0];
}
#include<iostream>
#include "CRRBinomialTree.h"
int main()
{
CRRBinomialTree *europeanCall, *europeanPut;
europeanCall = new CRRBinomialTree(0.10, 1.0, 100, 100.0, 100.0, 0.05, 0.0, 'C');
europeanPut = new CRRBinomialTree(0.10, 1.0, 100, 100.0, 100.0, 0.05, 0.0, 'P');
double V_0=0.0;
V_0 = europeanCall->pv();
std::cout << "nCall value = " << V_0;
V_0 = europeanPut->pv();
std::cout << "nPut value = " << V_0;
return 0;
}
1.6. Early exercise of American options on non-dividend paying stocks.
Consider the following two portfolios at time t:
Portfolio A: One European Call option c, Ke−r(T −t)
cash.
Portfolio B: One share of stock worth St
In portfolio A, the cash will grow to K at time T. If ST > K, the option will be exercised
at maturity, and the portfolio A is worth ST . If ST < K, the call option expires worthless
and the portfolio is worth K. Hence, at time T, the portfolio is worth
max(ST , K)
Portfolio B is worth ST at time T. Hence, portfolio A is always worth as much as, and
can be worth more than the portfolio B at maturity.
max(ST , K) ≥ ST
In the absence of arbitrage opportunities, this must also be true today.
8
9. Options pricing using Lattice models • October 2019 • with C++ code snippets
c + Ke−r(T −t)
≥ St
c ≥ St − Ke−r(T −t)
≥ (St − K)
So, the European call c is always worth more than its intrinsic at expiry. Because
the owner of an American call has all the exercise opportunities open to the owner of a
corresponding European call, we must have C ≥ c. Given r > 0, C > St − K. This means
that C is always greater than the option’s intrinsic value prior to maturity.
Hence, it is never optimal to exercise American call options on non-dividend paying
stocks.
2. TRINOMIAL TREES
Trinomial trees are used more in practice then binomial trees, since they allow for 3
states: up, down and middle moves. We can price both European and American options
with trinomial trees.
2.1. CRR Trinomial tree.
The CRR has a symmetric tree structure where,
u = eλσ
√
∆t
(1)
d = e−λσ
√
∆t
(2)
ud = m2
= 1 (3)
The necessary and sufficient condition for the tree to recombine is ud = m2
.
We can compute the option value in a trinomial tree as the discounted expectation in
a risk-neutral world by computing:
Ci,j = e−r∆t
(puCi+1,j+1 + pmCi+1,j + pdCi+1,j−1) (4)
As before, we match the first two moments of the trinomial and lognormal distributions.
puu + (1 − pu − pd) + pdd = em∆t
(5)
puu2
+ (1 − pu − pd) + pdd2
= e(2m+σ2
)∆t
(6)
If we take the first order approximations of the power series of ex
, we can solve for
pu, pm, pd as follows. Let k = λσ
√
∆t. The first moment yields :
puek
+ (1 − pu − pd) + pde−k
= er∆t
pu(1 + k + k2
/2) + (1 − pu − pd) + pd(1 − k + k2
/2) = (1 + r∆t)
pu(k + k2
/2) + pd(−k + k2
/2) = r∆t
(7)
9
10. Options pricing using Lattice models • October 2019 • with C++ code snippets
The second moment yields:
pue2k
+ (1 − pu − pd) + pde−2k
= e(2r+σ2
)∆t
2λσ
√
∆t(pu − pd) = 2r∆t + σ2
∆t
pu(1 + 2k + 2k2
) + (1 − pu − pd) + pd(1 − 2k + 2k2
) = (1 + 2r∆t + σ2
∆t)
pu(2k + 2k2
) + pd(−2k + 2k2
) = 2r∆t + σ2
∆t
(8)
Plugging in the value of r∆t from equation 7 into 8, we obtain:
pu(2k + 2k2
) + pd(−2k + 2k2
) = 2r∆t + σ2
∆t
pu(2k + 2k2
) + pd(−2k + 2k2
) = pu(2k + k2
) + pd(−2k + k2
) + σ2
∆t
(pu + pd)k2
= σ2
∆t
(1 − pm)λ2
σ2
∆t = σ2
∆t
1 − pm =
1
λ2
pm = 1 −
1
λ2
(9)
Multiplying the left and right hand sides of the equation 9 by (−k + k2
/2),
pu + pd =
σ2
∆t
k2
pu(−k + k2
/2) + pd(−k + k2
/2) =
σ2
∆t
λ2σ2∆t
(−k + k2
/2)
pu(−k + k2
/2) + pd(−k + k2
/2) =
1
λ2
(−k + k2
/2)
(10)
I now solve equations 7 and 10 simultaneously.
pu(2k) = r∆t −
1
λ2
(−k + k2
/2)
pu(2λσ
√
∆t) = r∆t +
λσ
√
∆t
λ2
−
λ2
σ2
∆t
2λ2
pu(2λσ) ≈ r
√
∆t +
σ
λ
pu =
1
2λ2
+
1
2
r
λσ
√
∆t
(11)
Since pu and pd should add up to 1/λ2
,
pd =
1
2λ2
−
1
2
r
λσ
√
∆t (12)
It has been found that the value of λ that produces the best convergence rate is:
λ =
3
2
10
11. Options pricing using Lattice models • October 2019 • with C++ code snippets
2.2. CRR Trinomial Tree implementation.
The following code implements an American CRR trinomial tree with λ = 3/2. Suppose
we use a trinomial tree to price an at-the-money (ATM) American call option on a stock
priced at 50 dollars, strike price of 50, volatility of 20 percent, risk-free rate of 6 percent,
annual dividend yield of 3 percent and time to maturity = 1 year. Thus, S = 50, K = 50,
σ = 0.20, r = 0.06, q = 0.03 and T = 1.
//CRRTrinomialTree.h
#include <iostream>
#include <array>
class CRRTrinomialTree
{
private:
double p_u,p_d,p_m;
std::array<std::array<double, 250>, 250> S;
std::array<std::array<double, 250>, 250> C;
double u;
double d;
double T;
int N;
double sigma;
double dt;
double r;
double s_0;
double K;
char optionType;
double q;
double drift;
public:
CRRTrinomialTree(double vol, double expiry, int numOfTimeSteps,
double spot, double strike, double rate, double div, char optType);
double pv();
double payOff(double s_t);
void printTree();
int x(int i, int j);
int y(int i, int j);
};
// CRRTrinomialTree.cpp : Computes the value of a American option
// using backwards induction in a CRR Trinomial tree
#include<iostream>
#include "CRRTrinomialTree.h"
#include <cmath>
#include <iomanip>
CRRTrinomialTree::CRRTrinomialTree(double vol, double expiry, int numOfTimeSteps,
11
12. Options pricing using Lattice models • October 2019 • with C++ code snippets
double spot, double strike, double rate, double div, char optType)
{
N = numOfTimeSteps;
T = expiry;
dt = T / N;
r = rate;
q = div;
sigma = vol;
drift = (r - q - pow(sigma, 2.0) / 2.0);
const double lambda = sqrt(3.0 / 2.0);
u = exp(lambda * sigma * sqrt(dt));
d = 1 / u;
p_u = (1 / (2 * pow(lambda, 2))) +
(1 / 2) * (drift / (lambda * sigma)) * sqrt(dt);
p_d = (1 / (2 * pow(lambda, 2))) -
(1 / 2) * (drift / (lambda * sigma)) * sqrt(dt);
p_m = 1 - (1 / pow(lambda, 2));
s_0 = spot;
K = strike;
optionType = optType;
S = { 0.0 };
C = { 0.0 };
//compute the stock prices at each node
//initialize call prices
for (int i = 0; i <= N; ++i)
{
for (int j = -i; j <= i; ++j)
{
S[x(i,j)][y(i,j)] = s_0 * pow(u, j);
C[x(i,j)][y(i,j)] = 0.0;
}
}
}
int CRRTrinomialTree::x(int i, int j)
{
return (i + j);
}
int CRRTrinomialTree::y(int i, int j)
{
return i;
}
void CRRTrinomialTree::printTree()
{
std::cout << "nStock price tree";
std::cout << std::setprecision(5);
12
13. Options pricing using Lattice models • October 2019 • with C++ code snippets
for(int i = 2*N; i>=0;--i)
{
std::cout << "nn";
for (int j = 0; j <= N; ++j)
{
std::cout << "t" << S[i][j];
}
}
std::cout << "nnCall price tree";
for (int i = 2 * N; i >= 0; --i)
{
std::cout << "nn";
for (int j = 0; j <= N; ++j)
{
std::cout << "t" << C[i][j];
}
}
}
double CRRTrinomialTree::payOff(double S_t)
{
if (optionType == 'C')
return std::max(S_t - K, 0.0);
if (optionType == 'P')
return std::max(K - S_t, 0.0);
}
double CRRTrinomialTree::pv()
{
double df = 0.0;
int h = 0;
//compute terminal payoffs
for (int j = N; j >= -N; --j)
{
C[x(N,j)][y(N,j)] = payOff(S[x(N,j)][y(N,j)]);
}
//work backwards
for (int i = N - 1; i >= 0; --i)
{
for (int j = i; j >= -i; --j)
{
df = exp(-r * dt);
double v_u = C[x(i + 1, j + 1)][y(i + 1, j + 1)];
double v_m = C[x(i + 1, j)][y(i + 1, j)];
double v_d = C[x(i + 1, j - 1)][y(i + 1, j - 1)];
13
14. Options pricing using Lattice models • October 2019 • with C++ code snippets
double discountedExpectation = df * (p_u * v_u
+ p_m * v_m + p_d * v_d);
C[x(i,j)][y(i,j)] = std::max(discountedExpectation,
payOff(S[x(i,j)][y(i,j)]));
}
}
return C[0][0];
}
// testCRRTrinomialTree.cpp
#include<iostream>
#include "CRRTrinomialTree.h"
int main()
{
CRRTrinomialTree* americanCall;
americanCall = new CRRTrinomialTree(0.20, 1, 4, 50, 50, 0.06, 0.03, 'C');
double V_0 = americanCall->pv();
std::cout << "nPut value = " << V_0;
americanCall->printTree();
return 0;
}
The American call price and tree are printed as shown below:
Call value = 4.22538
Stock price tree
0 0 0 0 81.607
0 0 0 0 72.2
0 0 0 72.2 63.878
0 0 0 63.878 56.515
0 0 63.878 56.515 50
0 0 56.515 50 44.236
0 56.515 50 44.236 39.137
0 50 44.236 39.137 34.626
50 44.236 39.137 34.626 30.634
Call price tree
14
15. Options pricing using Lattice models • October 2019 • with C++ code snippets
0 0 0 0 31.607
0 0 0 0 22.2
0 0 0 22.226 13.878
0 0 0 13.986 6.5145
0 0 14.09 6.6962 0
0 0 7.494 2.1392 0
0 8.0402 2.9013 0 0
0 3.6442 0.70244 0 0
4.2254 1.1834 0 0 0
3. FINITE DIFFERENCE METHODS
Numerical methods known as finite difference methods are used for pricing derivatives
by approximating the diffusion process that the derivative must follow. Finite difference
methods schemes are used to numerically solve PDEs. They are particular useful for
valuation, when a closed-form analytical solution does not exist. By discretizing the
continuous time PDE, the derivative security must follow, it is possible approximate the
evolution of the derivative prices and therefore the PV of the contract.
3.1. The Black Scholes PDE.
Consider an underlying asset with price x. The underlying price evolves according to:
dx = µxdt + σxdz (13)
Consider a derivative contract whose value C depends on the asset price x at time t,
and can be thought of as a function C(t, x) of the random asset price x and time t. Using
Ito’s lemma, the function of a stochastic variable follows the process :
dC =
∂C
∂t
+ µx
∂C
∂x
+
1
2
σ2
x2 ∂2
C
∂x2
dt + σx
∂C
∂x
dz (14)
In the same way as for the asset-pricing model in equation 13, the process for C(t, x)
has two components - the drift component and a volatility component. The drift term is
deterministic, involving the drift and volatility parameters of the asset price process and
the partials of C with respect to x and t. Fundamentally, the source of randomness dz in
the asset-price process in equation 13 is the same as that in the derivative-price process
in equation 14.
It should therefore be possible to eliminate the source of randomness to create a
riskless portfolio Π akin to a money market asset. Construct a portfolio Π by shorting the
derivative C and buying ∂C
∂x units of the underlying.
15
16. Options pricing using Lattice models • October 2019 • with C++ code snippets
Π = −C +
∂C
∂x
x (15)
The change in the value of the portfolio over the time period dt is the differential,
dΠ = −dC +
∂C
∂x
dx (16)
Subsituting for dC and dx in equation 16 and using equations 13 and 14,
dΠ = −
∂C
∂t
+ µx
∂C
∂x
+
1
2
σ2
x2 ∂2
C
∂x2
dt − σx
∂C
∂x
dz +
∂C
∂x
(µxdt + σxdz) (17)
Simplifying we obtain,
dΠ =
∂C
∂t
+
1
2
σ2
x2 ∂2
C
∂x2
dt (18)
Finally, the rate of return on the riskless portfolio is:
dΠ
Π
=
∂C
∂t + 1
2 σ2
x2 ∂2
C
∂x2 dt
−C + ∂C
∂x x
= rdt (19)
The derivative C(t, x) price must therefore be the solution of the partial differential
equation,
∂C
∂t
(t, x) + rx
∂C
∂x
(t, x) +
1
2
σ2
x2 ∂2
C
∂x2
(t, x) = rC(t, x) (20)
3.2. Difference operators.
The principle of the finite difference method is to approximate the derivatives in partial
differential equations by a linear combination of the function values.
The derivative of a function at the point x can be approximated as:
Forward difference divided by h:
∆h[f](x)
h
=
f(x + h) − f(x)
h
(21)
Backward difference divided by h:
h[f](x)
h
=
f(x) − f(x − h)
h
(22)
Central difference divided by h:
δh[f](x)
h
=
f(x + h/2) − f(x − h/2)
h
(23)
In an analogous way, one can obtain finite difference approximations to higher order
derivatives and differential operators.
16
17. Options pricing using Lattice models • October 2019 • with C++ code snippets
The second order central difference:
f (x) ≈
δ2
h[f](x)
h
=
f (x + h/2) − f (x − h/2)
h
=
f(x+h)−f(x)
h − f(x)−f(x−h)
h
h
=
f(x + h) − 2f(x) + f(x − h)
h2
(24)
The second order forward difference:
f (x) ≈
∆2
h[f](x)
h
=
f (x + h) − f (x)
h
=
f(x+2h)−f(x+h)
h − f(x+h)−f(x)
h
h
=
f(x + 2h) − 2f(x + h) + f(x)
h2
(25)
The second order backward difference:
f (x) ≈
2
h[f](x)
h
=
f (x) − f (x − h)
h
=
f(x)−f(x−h)
h − f(x−h)−f(x−2h)
h
h
=
f(x) − 2f(x − h) + f(x − 2h)
h2
(26)
Mixed partial derivatives can be obtained as follows. Taking the central difference of
the x and y variables, we could obtain, for example:
∂2
u
∂x∂y i,j
=
∂
∂x
∂u
∂y
≈
(∂u
∂y )i+1,j − (∂u
∂y )i−1,j
2∆x
=
ui+1,j+1−ui+1j−1
2∆y −
ui−1,j+1−ui−1j−1
2∆y
2∆x
=
ui+1,j+1 − ui+1,j−1 − ui−1,j+1 + ui−1,j−1
4∆x∆y
(27)
3.3. Explicit finite difference scheme.
Consider the Black Scholes PDE:
∂C
∂t
+ rS
∂C
∂S
+
1
2
σ2
S2 ∂2
C
∂S2
= rC (28)
subject to the payoff condition C(t, ST ) = max(ST − K)+
.
We can simply this PDE by substituting it with finite differences. First, let’s substitute
x = log S, so that ∂C
∂S = ∂C
∂x · ∂x
∂S = 1
S
∂C
∂x and ∂2
C
∂S2 = − 1
S2
∂C
∂x + 1
S2
∂2
C
∂x2 .
∂C
∂t
+ ν
∂C
∂x
+
1
2
σ2 ∂2
C
∂x2
= rC (29)
We imagine time and space divided up into discrete intervals (∆t and ∆x), this is the
finite difference grid or lattice.
To obtain the explicit finite difference method we approximate the equation 29 using a
forward difference for ∂C/∂t and central differences for ∂C/∂x and ∂2
C/∂x2
. Denote by
Ci,j = C(ti, xj)
Therefore,
∂C
∂t t=ti
=
Ci+1,j − Ci,j
∆t
(30)
17
18. Options pricing using Lattice models • October 2019 • with C++ code snippets
∂C
∂x x=xj
=
Ci+1,j+1 − Ci+1,j−1
2∆x
(31)
∂2
C
∂x2
x=xj
=
Ci+1,j+1 − 2Ci+1,j + Ci+1,j−1
∆x2
(32)
Figure 2: Stencils for grid points for explicit and implicit finite difference schemes in
solving a PDE that is first order in t and second order in x
Substituting these values in the equation 29 we obtain,
Ci+1,j − Ci,j
∆t
+r
Ci+1,j+1 − Ci+1,j−1
2∆x
+
1
2
σ2 Ci+1,j+1 − 2Ci+1,j + Ci+1,j−1
∆x2
= rCi,j (33)
Multiplying throughout by 2∆x2
∆t,
2r(∆x)2
∆tCi,j = 2(∆x)2
(Ci+1,j − Ci,j) + r∆x∆t(Ci+1,j+1 − Ci+1,j−1)
+ σ2
∆t(Ci+1,j+1 − 2Ci+1,j + Ci+1,j−1)
=⇒ Ci,j(2∆x2
)(1 + r∆t) = (r∆x∆t + σ2
∆t)Ci+1,j+1 + (2∆x2
− 2σ2
∆t)Ci+1,j
+ (σ2
∆t − r∆x∆t)Ci+1,j−1
=⇒ Ci,j =
1
1 + r∆t
∆t
r
2∆x
+
σ2
2∆x2
Ci+1,j+1 + 1 −
σ2
∆x2
∆t Ci+1,j
+
1
2
σ2
∆x2
−
r
∆x
∆t Ci+1,j−1
(34)
The coefficients of Ci+1,j+1, Ci+1,j and Ci+1,j−1 can be thought of as the trinomial
probabilities. (1 + r∆t) is the discounting factor.
Therefore the explicit finite difference method is equivalent of approximating the Black
Scholes diffusion process by a discrete trinomial process, where,
18
19. Options pricing using Lattice models • October 2019 • with C++ code snippets
Ci,j =
1
1 + r∆t
(puCi+1,j+1 + pmCi + 1, j + pdCi+1,j−1) (35)
pu = ∆t
r
2∆x
+
σ2
2∆x2
(36)
pm = 1 −
σ2
∆x2
∆t (37)
pd =
1
2
σ2
∆x2
−
r
∆x
∆t (38)
3.4. Explicit finite difference implementation.
We create a rectangular grid or lattice by adding extra nodes to a trinomial tree, so that
we have 2M + 1, M >= N at every time step i instead of just 2i + 1.
However, at time step i, given all option values at i + 1, we cannot compute the bottom
and top option values (Ci,−M and Ci,M ) using discounted expectations, since this would
require knowing option values Ci+1,−M−1 and Ci+1,M+1 which we do not have. With no
additional information we can only compute the region indicated by the dashed branches
using discounted expectations.
In order to be able to compute the remainder of the grid we must add the extra
boundary conditions which determine the behavior of the option price as a function asset
price for high and low values of the asset price xj.
For example, for a European call option we have the following Neumann boundary
conditions (the delta for deep ITM calls is 1, whereas for deep OTM calls is 0):
∂C
∂S
(t, S) = 1 for large S (39)
∂C
∂S
(t, S) = 0 for small S (40)
In terms of the grid, the conditions 39 and 40 become:
Ci,M − Ci,M−1
Si,M − Si,M−1
= 1 for large S (41)
Ci,−M+1 − Ci,−M
Si,−M+1 − Si,−M
= 0 for small S (42)
I price a one-year ATM European call option with S = 100, K = 100, T = 1 year, r = 0.06,
δ = 0.03, M = 3, N = 3, ∆x = 0.02.
// ExplicitFDMGrid.h
#include <iostream>
#include <array>
class ExplicitFDMGrid
{
19
20. Options pricing using Lattice models • October 2019 • with C++ code snippets
private:
double p_u, p_d, p_m;
std::array<std::array<double, 250>, 250> S;
std::array<std::array<double, 250>, 250> C;
double T;
long M;
long N;
double sigma;
double dt;
double r;
double s_0;
double K;
char optionType;
double q;
double drift;
double dx;
public:
ExplicitFDMGrid(double vol, double expiry, long N_, long M_,
double spot, double strike, double rate, double div, char optType, double dx);
double pv();
double payOff(double s_t);
void printTree();
int row(int i, int j);
int col(int i, int j);
};
// ExplicitFDMGrid.cpp : Computes the value of a European option
// the explicit finite difference method
#include<iostream>
#include "ExplicitFDMGrid.h"
#include <cmath>
#include <iomanip>
ExplicitFDMGrid::ExplicitFDMGrid(double vol, double expiry, long N_, long M_,
double spot, double strike, double rate, double div, char optType, double deltax)
{
N = N_; M = M_;
T = expiry;
dt = T / N;
r = rate;
q = div;
sigma = vol;
dx = deltax;
drift = (r - q - pow(sigma, 2.0) / 2.0);
p_u = 0.50 * dt * (pow((sigma/dx),2)+(drift/dx));
p_m = 1 - dt * (pow((sigma / dx), 2));
p_d = 0.50 * dt * (pow((sigma / dx), 2) - (drift / dx));
s_0 = spot;
K = strike;
20
21. Options pricing using Lattice models • October 2019 • with C++ code snippets
optionType = optType;
S = { 0.0 };
C = { 0.0 };
std::cout << "np_u = " << p_u;
std::cout << "np_m = " << p_m;
std::cout << "np_d = " << p_d;
//initialize the asset prices at maturity
//these apply to every time step
for (int j = -M; j <= M; ++j)
{
for (int i = 0; i <= N; ++i)
{
S[row(i, j)][col(i, j)] = s_0 * exp(j * dx);
}
}
//initialize the option values at maturity
for (int j = -M; j <= M; ++j)
{
C[row(N, j)][col(N, j)] = payOff(S[row(N, j)][col(N, j)]);
}
}
int ExplicitFDMGrid::row(int i, int j)
{
return (M+j);
}
int ExplicitFDMGrid::col(int i, int j)
{
return i;
}
void ExplicitFDMGrid::printTree()
{
std::cout << "nStock price tree";
std::cout << std::setprecision(8);
for (int j = 2 * M; j >= 0; --j)
{
std::cout << "nn";
for (int i = 0; i <= N; ++i)
{
std::cout << "t" << S[j][i];
}
}
21
22. Options pricing using Lattice models • October 2019 • with C++ code snippets
std::cout << "nnCall price tree";
for(int j = 2 * M; j >= 0; --j)
{
std::cout << "nn";
for (int i = 0; i <= N; ++i)
{
std::cout << "t" << C[j][i];
}
}
}
double ExplicitFDMGrid::payOff(double S_t)
{
if (optionType == 'C')
return std::max(S_t - K, 0.0);
if (optionType == 'P')
return std::max(K - S_t, 0.0);
}
double ExplicitFDMGrid::pv()
{
double df = 0.0;
//work backwards
for (int i = N - 1; i >= 0; --i)
{
for (int j = M - 1; j >= -M+1; --j)
{
df = exp(-r * dt);
double v_u = C[row(i + 1, j + 1)][col(i + 1, j + 1)];
double v_m = C[row(i + 1, j)][col(i + 1, j)];
double v_d = C[row(i + 1, j - 1)][col(i + 1, j - 1)];
C[row(i,j)][col(i,j)] = (p_u * v_u
+ p_m * v_m + p_d * v_d);
}
//Neumann boundary conditions
if (optionType == 'C')
{
C[row(i, M)][col(i, M)] = C[row(i, M - 1)][col(i, M - 1)] +
(S[row(i, M)][col(i, M)] - S[row(i, M - 1)][col(i, M - 1)]);
C[row(i, -M)][col(i, -M)] = C[row(i, -M + 1)][col(i, -M + 1)];
}
else if (optionType == 'P')
{
C[row(i, M)][col(i, M)] = C[row(i, M - 1)][col(i, M - 1)];
22
23. Options pricing using Lattice models • October 2019 • with C++ code snippets
C[row(i, -M)][col(i, -M)] = C[row(i, -M + 1)][col(i, -M + 1)] +
(S[row(i, -M)][col(i, -M)] - S[row(i, -M + 1)][col(i, -M + 1)]);
}
}
return C[row(0,0)][col(0,0)];
}
// test explicit FDM grid
#include<iostream>
#include "ExplicitFDMGrid.h"
int main()
{
ExplicitFDMGrid* g;
g = new ExplicitFDMGrid(0.20, 1, 3, 3, 100, 100, 0.06,0.03,'C',0.2);
double V_0 = g->pv();
std::cout << "nOption value = " << V_0;
g->printTree();
return 0;
}
REFERENCES
[1] Mark Rubinstein John Cox, Stephen Ross. Option pricing: A simplified approach.
Journal of Financial Economics, 1979.
23