@Override
    public Num calculate(BarSeries series, Position position) {
        Num numberOfPositions = numberOfPositionsCriterion.calculate(series, position);
        return standardDeviationCriterion.calculate(series, position).dividedBy(numberOfPositions.sqrt());
    }
@Test
    public void calculateStandardErrorPnL() {
        MockBarSeries series = new MockBarSeries(numFunction, 100, 105, 110, 100, 95, 105);
        TradingRecord tradingRecord = new BaseTradingRecord(Trade.buyAt(0, series, series.one()),
                Trade.sellAt(2, series, series.one()), Trade.buyAt(3, series, series.one()),
                Trade.sellAt(5, series, series.one()));

        AnalysisCriterion criterion = getCriterion(new ProfitLossCriterion());
        assertNumEquals(1.7677669529663687, criterion.calculate(series, tradingRecord));
    }