boundaryProbabilities function

Boundaries boundaryProbabilities(
  1. PricerInputs pricer,
  2. double? lower,
  3. double? upper
)

Price a range's two boundaries with the local float pricer. lower/upper are strikes in USD; pass null for an infinite side (lower: strike, upper: null is an UP order, lower: null, upper: strike a DOWN order). Carries the pricer's ~1e-4 approximation.

Implementation

Boundaries boundaryProbabilities(
    PricerInputs pricer, double? lower, double? upper) {
  return Boundaries(
    lowerUp:
        lower == null ? null : _toRawProbability(upProbability(pricer, lower)),
    higherUp:
        upper == null ? null : _toRawProbability(upProbability(pricer, upper)),
  );
}