Pnl Scalloping

Overview

PnL Scalloping is a method of PnL Attribution in Derivatives. It is based on the Path Based (Scalloping) Methodology.

The follwoing code utilizes the Black Scholes Library to implement a Pnl Scalloping algorithm.

Attribution Methodologies

let bs = await import('/code/black-scholes/v1.0.0/black-scholes.mjs'); let att = await import('/code/attribution/v1.0.0/attribution.mjs'); let price = function(S, sigma, r, t){ let K = 100; return bs.call(S,K,sigma,r,t); } let S0 = 100; let S1 = 105; let sigma0= 0.16; let sigma1 = 0.17; let r0 = 0.05; let r1 = 0.048; let t0 = 1; let t1 = 0.95 let attribution = att.path(price, [S0,sigma0,r0,t0],[S1,sigma1,r1,t1]);