{"categories":["FX"],"contentHtml":"<h3>Week 6 — 3 March 2025</h3><p>The syllabus labels this class “Black-Scholes shortcomings: discrete hedging; volatility uncertainty.” The source workbook expresses the risk measures as functions. It does not contain a separate prose lecture summary, so the functions are kept here as the primary note.</p><h4><math><mi mathvariant=\"normal\">Δ</mi></math>, <math><mi>𝜃</mi></math>, <math><mi mathvariant=\"normal\">Γ</mi></math>, vega, and <math><mi>𝜌</mi></math></h4><p>The functions below are transcribed from the workbook. BSDailyTheta uses a one-day change; BSVega uses a 0.01 volatility bump; the two <math><mi>𝜌</mi></math> functions use a one-basis-point domestic or foreign-rate bump.</p><pre><code>' Calculate the FX Delta of the option\nFunction BSDelta(ContractType As String, _\n                 Forward As Double, _\n                 Strike As Double, _\n                 Days As Double, _\n                 DiscRate As Double, _\n                 ExtRate As Double, _\n                 vol As Double)\n    T = Days / 365\n    S = Forward\n    X = Strike\n    r = DiscRate\n    v = vol\n    OptionType = ContractType\n    If OptionType = \"F\" Or OptionType = \"M\" Then\n        OptionDelta = Exp(-ExtRate * T)\n    ElseIf OptionType = \"D\" Then\n        OptionDelta = 0\n     ElseIf OptionType = \"C\" Then\n        OptionDelta = Exp(-ExtRate * T) * Application.NormSDist(dOne(S, X, T, r, v))\n    ElseIf OptionType = \"P\" Then\n        OptionDelta = Exp(-ExtRate * T) * (Application.NormSDist(dOne(S, X, T, r, v)) - 1)\n    End If\n     BSDelta = OptionDelta\nEnd Function\nFunction BSDailyTheta(ContractType As String, _\n                 Forward As Double, _\n                 Strike As Double, _\n                 Days As Double, _\n                 DiscRate As Double, _\n                 ExtRate As Double, _\n                 vol As Double)\n    T = Days / 365\n    S = Forward\n    X = Strike\n    r = DiscRate\n    rFor = ExtRate\n    v = vol\n    OptionType = ContractType\n    ' Making Sure Strike is OK for MXN Deposit\n    If OptionType = \"M\" Then\n        X = 0.0000000001\n    End If\n    If OptionType = \"F\" Or OptionType = \"M\" Then\n        Theta = BSPrice(ContractType, Forward * Exp(-(rFor - r) * (-1) / 365), Strike, Days - 1, DiscRate, ExtRate, vol)\n        Theta2 = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol)\n        Theta = Theta - Theta2\n    ElseIf OptionType = \"D\" Then\n        Theta = r * Exp(-r * T) * 1 / 365\n    ElseIf OptionType = \"C\" Then\n        Theta = BSPrice(ContractType, Forward * Exp(-(rFor - r) * (-1) / 365), Strike, Days - 1, DiscRate, ExtRate, vol)\n        Theta2 = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol)\n        Theta = Theta - Theta2\n    ElseIf OptionType = \"P\" Then\n        Theta = BSPrice(ContractType, Forward * Exp(-(rFor - r) * (-1) / 365), Strike, Days - 1, DiscRate, ExtRate, vol)\n        Theta2 = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol)\n        Theta = Theta - Theta2\n    End If\n  BSDailyTheta = Theta\nEnd Function\n' Calculate the Gamma of the contract\nFunction BSGamma(ContractType As String, _\n                 Forward As Double, _\n                 Strike As Double, _\n                 Days As Double, _\n                 DiscRate As Double, _\n                 ExtRate As Double, _\n                 vol As Double)\n    T = Days / 365\n    S = Forward\n    X = Strike\n    r = DiscRate\n    v = vol\n    OptionType = ContractType\n    If OptionType = \"D\" Or OptionType = \"M\" Then\n         Gamma = 0\n    ElseIf OptionType = \"F\" Then\n    Gamma = 0\n    ElseIf OptionType = \"C\" Then\n        Gamma = Exp(-(2 * ExtRate - DiscRate) * T) * NdOne(S, X, T, r, v) / (S * (v * Sqr(T)))\n    ElseIf OptionType = \"P\" Then\n        Gamma = Exp(-(2 * ExtRate - DiscRate) * T) * NdOne(S, X, T, r, v) / (S * (v * Sqr(T)))\n    End If\n  BSGamma = Gamma\nEnd Function\n' Function to calculate the Vega\nFunction BSVega(ContractType As String, _\n                 Forward As Double, _\n                 Strike As Double, _\n                 Days As Double, _\n                 DiscRate As Double, _\n                 ExtRate As Double, _\n                 vol As Double)\n    T = Days / 365\n    S = Forward\n    X = Strike\n    r = DiscRate\n    v = vol\n    OptionType = ContractType\n    If OptionType = \"F\" Or OptionType = \"D\" Or OptionType = \"M\" Then\n         Vega = 0\n    ElseIf OptionType = \"C\" Then\n        VegaBase = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol)\n        VegaBump = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol + 0.01)\n        Vega = VegaBump - VegaBase\n    ElseIf OptionType = \"P\" Then\n        Vega = 0\n        VegaBase = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol)\n        VegaBump = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol + 0.01)\n        Vega = VegaBump - VegaBase\n    End If\n  BSVega = Vega\nEnd Function\n'Function that calculates the sensitivity to 1bps bump on Domestic interest rates (usually USD rates)\nFunction BSDailyRhoUSD(ContractType As String, _\n                 Forward As Double, _\n                 Strike As Double, _\n                 Days As Double, _\n                 DiscRate As Double, _\n                 ExtRate As Double, _\n                 vol As Double)\n    T = Days / 365\n    S = Forward\n    X = Strike\n    r = DiscRate\n    rFor = ExtRate\n    v = vol\n    OptionType = ContractType\n    ' Making Sure Strike is OK for MXN Deposit\n    If OptionType = \"M\" Then\n        X = 0.0000000001\n    End If\n    If OptionType = \"F\" Or OptionType = \"M\" Then\n       Rho = BSPrice(ContractType, Forward * Exp(0.0001 * T), Strike, Days, DiscRate + 0.0001, ExtRate, vol)\n       Rho2 = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol)\n       Rho = Rho - Rho2\n    ElseIf OptionType = \"D\" Then\n       Rho = -T * Exp(-r * T) * 0.0001\n    ElseIf OptionType = \"C\" Then\n       Rho = BSPrice(ContractType, Forward * Exp(0.0001 * T), Strike, Days, DiscRate + 0.0001, ExtRate, vol)\n       Rho2 = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol)\n       Rho = Rho - Rho2\n    ElseIf OptionType = \"P\" Then\n       Rho = BSPrice(ContractType, Forward * Exp(0.0001 * T), Strike, Days, DiscRate + 0.0001, ExtRate, vol)\n       Rho2 = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol)\n       Rho = Rho - Rho2\n'----------------------------------------------\n    End If\n  BSDailyRhoUSD = Rho\nEnd Function\n'Function that calculates the sensitivity to 1bps bump on External interest rates (usually MXN rates)\nFunction BSDailyRhoExt(ContractType As String, _\n                 Forward As Double, _\n                 Strike As Double, _\n                 Days As Double, _\n                 DiscRate As Double, _\n                 ExtRate As Double, _\n                 vol As Double)\n    T = Days / 365\n    S = Forward\n    X = Strike\n    r = DiscRate\n    rFor = ExtRate\n    v = vol\n    OptionType = ContractType\n    ' Making Sure Strike is OK for MXN Deposit\n    If OptionType = \"M\" Then\n        X = 0.0000000001\n    End If\n    If OptionType = \"F\" Or OptionType = \"M\" Then\n       Rho = BSPrice(ContractType, Forward * Exp(-0.0001 * T), Strike, Days, DiscRate, ExtRate, vol)\n       Rho2 = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol)\n       Rho = Rho - Rho2\n    ElseIf OptionType = \"D\" Then\n       Rho = BSPrice(ContractType, Forward * Exp(-0.0001 * T), Strike, Days, DiscRate, ExtRate, vol)\n       Rho2 = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol)\n       Rho = Rho - Rho2\n    ElseIf OptionType = \"C\" Then\n       Rho = BSPrice(ContractType, Forward * Exp(-0.0001 * T), Strike, Days, DiscRate, ExtRate, vol)\n       Rho2 = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol)\n       Rho = Rho - Rho2\n    ElseIf OptionType = \"P\" Then\n       Rho = BSPrice(ContractType, Forward * Exp(-0.0001 * T), Strike, Days, DiscRate, ExtRate, vol)\n       Rho2 = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol)\n       Rho = Rho - Rho2\n    End If\n  BSDailyRhoExt = Rho\nEnd Function</code></pre><p>The implementation makes the discrete-hedging convention concrete: the “Greek” is a finite bump around the workbook’s forward, strike, rates, volatility, and 365-day maturity convention.</p>","contentSourceFormat":"typst","contentTypst":"== Week 6 --- 3 March 2025\n<week-6-3-march-2025>\nThe syllabus labels this class \"Black-Scholes shortcomings: discrete hedging; volatility uncertainty.\" The source workbook expresses the risk measures as functions. It does not contain a separate prose lecture summary, so the functions are kept here as the primary note.\n\n=== $Delta$, $theta$, $Gamma$, vega, and $rho$\n<delta-theta-gamma-vega-and-rho>\nThe functions below are transcribed from the workbook. BSDailyTheta uses a one-day change; BSVega uses a 0.01 volatility bump; the two $rho$ functions use a one-basis-point domestic or foreign-rate bump.\n\n```vb\n' Calculate the FX Delta of the option\nFunction BSDelta(ContractType As String, _\n                 Forward As Double, _\n                 Strike As Double, _\n                 Days As Double, _\n                 DiscRate As Double, _\n                 ExtRate As Double, _\n                 vol As Double)\n    T = Days / 365\n    S = Forward\n    X = Strike\n    r = DiscRate\n    v = vol\n    OptionType = ContractType\n    If OptionType = \"F\" Or OptionType = \"M\" Then\n        OptionDelta = Exp(-ExtRate * T)\n    ElseIf OptionType = \"D\" Then\n        OptionDelta = 0\n     ElseIf OptionType = \"C\" Then\n        OptionDelta = Exp(-ExtRate * T) * Application.NormSDist(dOne(S, X, T, r, v))\n    ElseIf OptionType = \"P\" Then\n        OptionDelta = Exp(-ExtRate * T) * (Application.NormSDist(dOne(S, X, T, r, v)) - 1)\n    End If\n     BSDelta = OptionDelta\nEnd Function\nFunction BSDailyTheta(ContractType As String, _\n                 Forward As Double, _\n                 Strike As Double, _\n                 Days As Double, _\n                 DiscRate As Double, _\n                 ExtRate As Double, _\n                 vol As Double)\n    T = Days / 365\n    S = Forward\n    X = Strike\n    r = DiscRate\n    rFor = ExtRate\n    v = vol\n    OptionType = ContractType\n    ' Making Sure Strike is OK for MXN Deposit\n    If OptionType = \"M\" Then\n        X = 0.0000000001\n    End If\n    If OptionType = \"F\" Or OptionType = \"M\" Then\n        Theta = BSPrice(ContractType, Forward * Exp(-(rFor - r) * (-1) / 365), Strike, Days - 1, DiscRate, ExtRate, vol)\n        Theta2 = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol)\n        Theta = Theta - Theta2\n    ElseIf OptionType = \"D\" Then\n        Theta = r * Exp(-r * T) * 1 / 365\n    ElseIf OptionType = \"C\" Then\n        Theta = BSPrice(ContractType, Forward * Exp(-(rFor - r) * (-1) / 365), Strike, Days - 1, DiscRate, ExtRate, vol)\n        Theta2 = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol)\n        Theta = Theta - Theta2\n    ElseIf OptionType = \"P\" Then\n        Theta = BSPrice(ContractType, Forward * Exp(-(rFor - r) * (-1) / 365), Strike, Days - 1, DiscRate, ExtRate, vol)\n        Theta2 = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol)\n        Theta = Theta - Theta2\n    End If\n  BSDailyTheta = Theta\nEnd Function\n' Calculate the Gamma of the contract\nFunction BSGamma(ContractType As String, _\n                 Forward As Double, _\n                 Strike As Double, _\n                 Days As Double, _\n                 DiscRate As Double, _\n                 ExtRate As Double, _\n                 vol As Double)\n    T = Days / 365\n    S = Forward\n    X = Strike\n    r = DiscRate\n    v = vol\n    OptionType = ContractType\n    If OptionType = \"D\" Or OptionType = \"M\" Then\n         Gamma = 0\n    ElseIf OptionType = \"F\" Then\n    Gamma = 0\n    ElseIf OptionType = \"C\" Then\n        Gamma = Exp(-(2 * ExtRate - DiscRate) * T) * NdOne(S, X, T, r, v) / (S * (v * Sqr(T)))\n    ElseIf OptionType = \"P\" Then\n        Gamma = Exp(-(2 * ExtRate - DiscRate) * T) * NdOne(S, X, T, r, v) / (S * (v * Sqr(T)))\n    End If\n  BSGamma = Gamma\nEnd Function\n' Function to calculate the Vega\nFunction BSVega(ContractType As String, _\n                 Forward As Double, _\n                 Strike As Double, _\n                 Days As Double, _\n                 DiscRate As Double, _\n                 ExtRate As Double, _\n                 vol As Double)\n    T = Days / 365\n    S = Forward\n    X = Strike\n    r = DiscRate\n    v = vol\n    OptionType = ContractType\n    If OptionType = \"F\" Or OptionType = \"D\" Or OptionType = \"M\" Then\n         Vega = 0\n    ElseIf OptionType = \"C\" Then\n        VegaBase = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol)\n        VegaBump = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol + 0.01)\n        Vega = VegaBump - VegaBase\n    ElseIf OptionType = \"P\" Then\n        Vega = 0\n        VegaBase = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol)\n        VegaBump = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol + 0.01)\n        Vega = VegaBump - VegaBase\n    End If\n  BSVega = Vega\nEnd Function\n'Function that calculates the sensitivity to 1bps bump on Domestic interest rates (usually USD rates)\nFunction BSDailyRhoUSD(ContractType As String, _\n                 Forward As Double, _\n                 Strike As Double, _\n                 Days As Double, _\n                 DiscRate As Double, _\n                 ExtRate As Double, _\n                 vol As Double)\n    T = Days / 365\n    S = Forward\n    X = Strike\n    r = DiscRate\n    rFor = ExtRate\n    v = vol\n    OptionType = ContractType\n    ' Making Sure Strike is OK for MXN Deposit\n    If OptionType = \"M\" Then\n        X = 0.0000000001\n    End If\n    If OptionType = \"F\" Or OptionType = \"M\" Then\n       Rho = BSPrice(ContractType, Forward * Exp(0.0001 * T), Strike, Days, DiscRate + 0.0001, ExtRate, vol)\n       Rho2 = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol)\n       Rho = Rho - Rho2\n    ElseIf OptionType = \"D\" Then\n       Rho = -T * Exp(-r * T) * 0.0001\n    ElseIf OptionType = \"C\" Then\n       Rho = BSPrice(ContractType, Forward * Exp(0.0001 * T), Strike, Days, DiscRate + 0.0001, ExtRate, vol)\n       Rho2 = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol)\n       Rho = Rho - Rho2\n    ElseIf OptionType = \"P\" Then\n       Rho = BSPrice(ContractType, Forward * Exp(0.0001 * T), Strike, Days, DiscRate + 0.0001, ExtRate, vol)\n       Rho2 = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol)\n       Rho = Rho - Rho2\n'----------------------------------------------\n    End If\n  BSDailyRhoUSD = Rho\nEnd Function\n'Function that calculates the sensitivity to 1bps bump on External interest rates (usually MXN rates)\nFunction BSDailyRhoExt(ContractType As String, _\n                 Forward As Double, _\n                 Strike As Double, _\n                 Days As Double, _\n                 DiscRate As Double, _\n                 ExtRate As Double, _\n                 vol As Double)\n    T = Days / 365\n    S = Forward\n    X = Strike\n    r = DiscRate\n    rFor = ExtRate\n    v = vol\n    OptionType = ContractType\n    ' Making Sure Strike is OK for MXN Deposit\n    If OptionType = \"M\" Then\n        X = 0.0000000001\n    End If\n    If OptionType = \"F\" Or OptionType = \"M\" Then\n       Rho = BSPrice(ContractType, Forward * Exp(-0.0001 * T), Strike, Days, DiscRate, ExtRate, vol)\n       Rho2 = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol)\n       Rho = Rho - Rho2\n    ElseIf OptionType = \"D\" Then\n       Rho = BSPrice(ContractType, Forward * Exp(-0.0001 * T), Strike, Days, DiscRate, ExtRate, vol)\n       Rho2 = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol)\n       Rho = Rho - Rho2\n    ElseIf OptionType = \"C\" Then\n       Rho = BSPrice(ContractType, Forward * Exp(-0.0001 * T), Strike, Days, DiscRate, ExtRate, vol)\n       Rho2 = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol)\n       Rho = Rho - Rho2\n    ElseIf OptionType = \"P\" Then\n       Rho = BSPrice(ContractType, Forward * Exp(-0.0001 * T), Strike, Days, DiscRate, ExtRate, vol)\n       Rho2 = BSPrice(ContractType, Forward, Strike, Days, DiscRate, ExtRate, vol)\n       Rho = Rho - Rho2\n    End If\n  BSDailyRhoExt = Rho\nEnd Function\n```\n\nThe implementation makes the discrete-hedging convention concrete: the \"Greek\" is a finite bump around the workbook's forward, strike, rates, volatility, and 365-day maturity convention.","dataUrl":"https://sharifhsn.dev/api/posts/fx-discrete-hedging-and-greeks.json","date":"2025-03-03","datePublished":"2025-03-03","description":"The syllabus labels this class “Black-Scholes shortcomings: discrete hedging; volatility uncertainty.” The source workbook expresses the risk measures as functions. It does not…","site":"https://sharifhsn.dev","slug":"fx-discrete-hedging-and-greeks","source":"FE-635 | Risk Engineering","sourceUrl":null,"tags":["FX","Greeks","Discrete Hedging"],"title":"FX Discrete Hedging and Greeks","url":"https://sharifhsn.dev/blog/fx-discrete-hedging-and-greeks/","version":"1","wordCount":1149}