You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FinancePy already implements power-option pricing in financepy/models/bs_power_option.py and EquityPowerOption. The original draft inadvertently replaced that existing API; that has been corrected. No duplicate pricer or replacement API remains.
New functionality: a JIT-compiled analytical spot delta for European power calls and puts, exposed through the existing EquityPowerOption.delta() method. Previously the inherited EquityOption.delta() used stock-price finite differences. The new closed-form derivative is phi * n * M_n / S * N(phi*d1) for n > 0, where M_n is the discounted n-th stock-price moment already used by the existing pricing function.
Response to maintainer feedback
Only strictly positive powers. Constructor rejects zero, negative, or non-finite power with FinError; the low-level model preserves FinancePy's existing NaN convention for non-positive powers.
Existing pricing preserved. Restored the upstream power_option_value(s,t,k,r,q,v,opt_type_value,n) function and its signature; existing equity product valuation and Monte Carlo pricing remain unchanged.
Precise added value.power_option_delta() in the existing model module, a product-level delta override, and a focused regression suite. No new PowerOption facade.
Verification
The new unit suite tests finite-difference agreement with the existing power-option pricer for fractional/integer positive powers, calls/puts, the n=1 Black–Scholes delta limit, quantity scaling, invalid powers and zero volatility. Finite-difference tolerances account for FinancePy's existing six-decimal approximate normcdf. 10 independent numerical formula checks passed; full repository unit/regression workflows are running on GitHub.
Related to #12 (analytical Greek enhancement to the existing product; no new FX product).
AIM-IT4
changed the title
Implement analytic European power option pricing and delta (#12)
Add analytical delta to existing EquityPowerOption (positive powers only)
Oct 15, 2026
Thanks for pointing this out. You are right: FinancePy already has power_option_value and EquityPowerOption, and the initial PR duplicated/replaced the existing implementation. I missed that.
I've revised this PR to preserve the existing pricing API and add only an analytical spot delta to the existing power-option model and EquityPowerOption.delta(). The current base-class delta is finite-difference based, so the new contribution is the closed-form Greek and its regression coverage.
I've also removed support for non-positive powers: EquityPowerOption now rejects n <= 0 (and non-finite values). Tests cover positive fractional/integer powers, both option types, the n=1 Black–Scholes limit, and comparisons against the existing pricer. Independent numerical checks pass; the updated GitHub CI is running.
Apologies for the duplicate implementation in the initial draft. Please let me know if analytical delta is a useful addition here, or if you'd prefer a different scope.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope of the revised PR
FinancePy already implements power-option pricing in
financepy/models/bs_power_option.pyandEquityPowerOption. The original draft inadvertently replaced that existing API; that has been corrected. No duplicate pricer or replacement API remains.New functionality: a JIT-compiled analytical spot delta for European power calls and puts, exposed through the existing
EquityPowerOption.delta()method. Previously the inheritedEquityOption.delta()used stock-price finite differences. The new closed-form derivative isphi * n * M_n / S * N(phi*d1)forn > 0, whereM_nis the discounted n-th stock-price moment already used by the existing pricing function.Response to maintainer feedback
powerwithFinError; the low-level model preserves FinancePy's existing NaN convention for non-positive powers.power_option_value(s,t,k,r,q,v,opt_type_value,n)function and its signature; existing equity product valuation and Monte Carlo pricing remain unchanged.power_option_delta()in the existing model module, a product-level delta override, and a focused regression suite. No newPowerOptionfacade.Verification
The new unit suite tests finite-difference agreement with the existing power-option pricer for fractional/integer positive powers, calls/puts, the n=1 Black–Scholes delta limit, quantity scaling, invalid powers and zero volatility. Finite-difference tolerances account for FinancePy's existing six-decimal approximate
normcdf. 10 independent numerical formula checks passed; full repository unit/regression workflows are running on GitHub.Related to #12 (analytical Greek enhancement to the existing product; no new FX product).