@Override
    public Num calculate(BarSeries series, Position position) {
        return position.getProfit();
    }
@Test
    public void calculateOnlyWithLossPositions() {
        MockBarSeries series = new MockBarSeries(numFunction, 100, 95, 100, 80, 85, 70);
        TradingRecord tradingRecord = new BaseTradingRecord(Trade.buyAt(0, series, series.numOf(50)),
                Trade.sellAt(1, series, series.numOf(50)), Trade.buyAt(2, series, series.numOf(50)),
                Trade.sellAt(5, series, series.numOf(50)));

        AnalysisCriterion profit = getCriterion();
        assertNumEquals(-250 - 1500, profit.calculate(series, tradingRecord));
    }