@Override
    public Num calculate(Position position, int currentIndex) {
        Num pricePerAsset = position.getEntry().getPricePerAsset();
        Num multiplier = pricePerAsset.one();
        if (position.isClosed()) {
            multiplier = pricePerAsset.numOf(2);
        }
        return pricePerAsset.numOf(feePerTrade).multipliedBy(multiplier);
    }
@Test
    public void calculatePerPositionWhenPositionIsClosed() {
        double positionTrades = 2;
        double feePerTrade = RANDOM.nextDouble();
        FixedTransactionCostModel model = new FixedTransactionCostModel(feePerTrade);

        int holdingPeriod = 2;
        Trade entry = Trade.buyAt(0, PRICE, AMOUNT, model);
        Trade exit = Trade.sellAt(holdingPeriod, PRICE, AMOUNT, model);

        Position position = new Position(entry, exit, model, model);
        Num cost = model.calculate(position, RANDOM.nextInt());

        assertNumEquals(cost, DoubleNum.valueOf(feePerTrade * positionTrades));
    }