constructPortfolioWriter(_toolContext, portfolioName, _write, _mergePositions, _keepCurrentPositions);
SimplePortfolioCopier portfolioCopier = new SimplePortfolioCopier(_structure);
// Create visitor for verbose/quiet mode
PortfolioCopierVisitor portfolioCopierVisitor =
_verbose ? new VerbosePortfolioCopierVisitor() : new QuietPortfolioCopierVisitor();
// Call the portfolio loader with the supplied arguments
portfolioCopier.copy(portfolioReader, portfolioWriter, portfolioCopierVisitor);
// close stuff