PowerMatcher - The Java implementation of the PowerMatcher, including the API, the core, a couple of examples, a remote implementation using websockets and a visualisation of the configuration.
Is the price step 0-based or 1-based. Because the check allows both 0 and 'number of pricesteps'. It seems like priceStep should only be allowed to be smaller or equal to marketBasis.getPriceSteps() - 1.
public static Price fromPriceStep(MarketBasis marketBasis, double priceStep) {
if (marketBasis == null) {
throw new IllegalArgumentException("marketBasis cannot be null");
}
if (priceStep < 0 || priceStep > marketBasis.getPriceSteps()) {
throw new IllegalArgumentException("priceStep is not in the range of the marketBasis");
}
return new Price(marketBasis, marketBasis.getMinimumPrice() + priceStep * marketBasis.getPriceIncrement());
}
Is the price step 0-based or 1-based. Because the check allows both 0 and 'number of pricesteps'. It seems like priceStep should only be allowed to be smaller or equal to
marketBasis.getPriceSteps() - 1
.