@Override
    public Num calculate(BarSeries series, Position position) {
        return position.hasLoss() ? series.one() : series.zero();
    }
@Test
    public void calculateWithTwoShortPositions() {
        MockBarSeries series = new MockBarSeries(numFunction, 100, 105, 110, 100, 95, 105);
        TradingRecord tradingRecord = new BaseTradingRecord(Trade.sellAt(0, series), Trade.buyAt(1, series),
                Trade.sellAt(3, series), Trade.buyAt(5, series));

        assertNumEquals(2, getCriterion().calculate(series, tradingRecord));
    }