private PositionGenerator createSimplePositionGenerator(final InMemorySecuritySource source) {
return new SimplePositionGenerator<RawSecurity>(new StaticQuantityGenerator(10), new SecurityGenerator<RawSecurity>() {
@Override
public RawSecurity createSecurity() {
return new RawSecurity();
}
@Override
public ManageableTrade createSecurityTrade(QuantityGenerator quantityGenerator, SecurityPersister securityPersister, NameGenerator counterPartyGenerator) {
ManageableTrade trade = null;
RawSecurity security = createSecurity();
ZonedDateTime tradeDate = ZonedDateTime.now();
trade = new ManageableTrade(quantityGenerator.createQuantity(), securityPersister.storeSecurity(security), tradeDate.toLocalDate(), tradeDate.toOffsetDateTime().toOffsetTime(),
ExternalId.of(Counterparty.DEFAULT_SCHEME, counterPartyGenerator.createName()));
return trade;
}