@Override
    public Num calculate(BarSeries series, Position position) {
        final Num maxDrawdown = maxDrawdownCriterion.calculate(series, position);
        if (maxDrawdown.isZero()) {
            return NaN.NaN;
        } else {
            final Num totalProfit = grossReturnCriterion.calculate(series, position);
            return totalProfit.dividedBy(maxDrawdown);
        }
    }
@Test
    public void rewardRiskRatioCriterionWithNoPositions() {
        MockBarSeries series = new MockBarSeries(numFunction, 1, 2, 3, 6, 8, 20, 3);
        assertTrue(rrc.calculate(series, new BaseTradingRecord()).isNaN());
    }