@Override
    public Num calculate(BarSeries series, Position position) {
        return criterion.calculate(series, position).dividedBy(enterAndHoldCriterion.calculate(series, position));
    }
@Test
    public void calculateWithNumberOfBars() {
        MockBarSeries series = new MockBarSeries(numFunction, 100, 95, 100, 80, 85, 130);
        TradingRecord tradingRecord = new BaseTradingRecord(Trade.buyAt(0, series), Trade.sellAt(1, series),
                Trade.buyAt(2, series), Trade.sellAt(5, series));

        AnalysisCriterion buyAndHold = getCriterion(new NumberOfBarsCriterion());

        assertNumEquals(6d / 6d, buyAndHold.calculate(series, tradingRecord));
    }