/src/main/java/net/finmath/montecarlo/assetderivativevaluation/products/BlackScholesHedgedPortfolio.java
final RandomVariable stocksToBuy = numeraireToday.sub( amountOfUnderlyingAsset) ;
final RandomVariable stocksToBuy = newNumberOfStocks.sub ( amountOfUnderlyingAsset ) ;
newNumberOfHedgeOptions = new Scalar(0.0); break; } final RandomVariable hedgeOptionsToBuy = newNumberOfHedgeOptions.sub(amountOfHedgeOptions); delta = delta.sub(newNumberOfHedgeOptions.mult(deltaOfHedgeOption)); final RandomVariable newNumberOfStocks = delta; <extra_id_0> final RandomVariable numeraireAssetsToSell = stocksToBuy.mult(underlyingAtTimeIndex).add(hedgeOptionsToBuy.mult(priceOfHedgeOption)).div(numeraireAtTimeIndex); final RandomVariable newNumberOfNumeraireAsset = amountOfNumeraireAsset.sub(numeraireAssetsToSell); amountOfNumeraireAsset = newNumberOfNumeraireAsset; amountOfUnderlyingAsset = newNumberOfStocks; amountOfHedgeOptions = newNumberOfHedgeOptions; }