I was trying to add Barrier Options (Equity) via web interface, but realized that this option is not available. Figured out that I need to start from scratch to add these options — something similar to what is being done in VanillaFXOptionPortfolioGeneratorTool. I tried something similar in EquityEuropeanDigitalsPortfolioGenerator
final ExerciseType european = new EuropeanExerciseType();
ExternalId test1 = ExternalSchemes.syntheticSecurityId("TestingOption1");
final EquityBarrierOptionSecurity barrierOption1 = new EquityBarrierOptionSecurity(OptionType.CALL,100,Currency.USD,test1,european,new Expiry(DateUtils.getUTCDate(2013, 5, 11)),0,"",BarrierType.UP,BarrierDirection.KNOCK_OUT,MonitoringType.DISCRETE,SamplingFrequency.ONE_LOOK,103);
again repeat of similar lines for other options. I override also similar methods as was done in that class.
Also in ExampleDatabasePopulator.java I added the following code (which is called in doRun())
private void loadBarrierPortfolio()
{
final Log log = new Log(“Creating example Barrier portfolio”);
try {
portfolioGeneratorTool().run(getToolContext(), BARRIER_PORTFOLIO_NAME, “EquityEuropeanDigitals”, true, null);
log.done();
} catch (final RuntimeException t) {
log.fail(t);
}
}
I haven’t configured the view definitions as I was just trying to see if the db is populated with this new security. Apparently the command ant init-database throws an exception saying it can’t find the instance
[java] com.opengamma.OpenGammaRuntimeException: Couldn't create generator tool instance for EquityEuropeanDigitals
[java] at com.opengamma.financial.generator.AbstractPortfolioGeneratorTool.getInstance(AbstractPortfolioGeneratorTool.java:222)
[java] at com.opengamma.financial.generator.AbstractPortfolioGeneratorTool.getInstance(AbstractPortfolioGeneratorTool.java:227)
[java] at com.opengamma.financial.generator.AbstractPortfolioGeneratorTool.run(AbstractPortfolioGeneratorTool.java:231)
Any suggestions on how to resolve this error? Thanks in advance for your help.