/src/main/java/net/finmath/montecarlo/assetderivativevaluation/products/BlackScholesDeltaHedgedPortfolio.java
final RandomVariable numeraireAtEvaluationTime = model.getNumeraire( evaluationTime) ;final RandomVariable underlyingAtEvaluationTime = model.getAssetValue( evaluationTime,0) ;
final RandomVariable underlyingAtEvaluationTime = model.getAssetValue ( evaluationTime,0 ) ;
final RandomVariable stocksToBuy = newNumberOfStocks.sub(amountOfUnderlyingAsset); final RandomVariable numeraireAssetsToSell = stocksToBuy.mult(underlyingAtTimeIndex).div(numeraireAtTimeIndex); final RandomVariable newNumberOfNumeraireAsset = amountOfNumeraireAsset.sub(numeraireAssetsToSell); amountOfNumeraireAsset = newNumberOfNumeraireAsset; amountOfUnderlyingAsset = newNumberOfStocks; } <extra_id_0> final RandomVariable numeraireAtEvaluationTime = model.getNumeraire(evaluationTime); final RandomVariable portfolioValue = amountOfNumeraireAsset.mult(numeraireAtEvaluationTime) .add(amountOfUnderlyingAsset.mult(underlyingAtEvaluationTime)); return portfolioValue; } }