@Override
    public Num calculate(BarSeries series, Position position) {
        return isConsecutive(position) ? series.one() : series.zero();
    }
@Test
    public void calculateWithTwoShortPositions() {
        MockBarSeries seriesLoss = new MockBarSeries(numFunction, 100, 90, 110, 120, 95, 105);
        TradingRecord tradingRecordLoss = new BaseTradingRecord(Trade.sellAt(0, seriesLoss), Trade.buyAt(1, seriesLoss),
                Trade.sellAt(3, seriesLoss), Trade.buyAt(5, seriesLoss));
        assertNumEquals(0, getCriterion(PositionFilter.LOSS).calculate(seriesLoss, tradingRecordLoss));

        MockBarSeries seriesProfit = new MockBarSeries(numFunction, 100, 105, 110, 100, 95, 105);
        TradingRecord tradingRecordProfit = new BaseTradingRecord(Trade.sellAt(0, seriesProfit),
                Trade.buyAt(1, seriesProfit), Trade.sellAt(3, seriesProfit), Trade.buyAt(5, seriesProfit));
        assertNumEquals(0, getCriterion(PositionFilter.PROFIT).calculate(seriesProfit, tradingRecordProfit));
    }