public static void main(String[] args) {

        // Getting the bar series
        BarSeries series = CsvTradesLoader.loadBitstampSeries();
        // Building the short selling trading strategy
        Strategy strategy = buildShortSellingMomentumStrategy(series);

        // Setting the trading cost models
        double feePerTrade = 0.0005;
        double borrowingFee = 0.00001;
        CostModel transactionCostModel = new LinearTransactionCostModel(feePerTrade);
        CostModel borrowingCostModel = new LinearBorrowingCostModel(borrowingFee);

        // Running the strategy
        BarSeriesManager seriesManager = new BarSeriesManager(series, transactionCostModel, borrowingCostModel);
        Trade.TradeType entryTrade = Trade.TradeType.SELL;
        TradingRecord tradingRecord = seriesManager.run(strategy, entryTrade);

        DecimalFormat df = new DecimalFormat("##.##");
        System.out.println("------------ Borrowing Costs ------------");
        tradingRecord.getPositions()
                .forEach(position -> System.out.println("Borrowing cost for "
                        + df.format(position.getExit().getIndex() - position.getEntry().getIndex()) + " periods is: "
                        + df.format(position.getHoldingCost().doubleValue())));
        System.out.println("------------ Transaction Costs ------------");
        tradingRecord.getPositions()
                .forEach(position -> System.out.println("Transaction cost for selling: "
                        + df.format(position.getEntry().getCost().doubleValue()) + " -- Transaction cost for buying: "
                        + df.format(position.getExit().getCost().doubleValue())));
    }
@Test
    public void test() {
        TradeCost.main(null);
    }