@Test public void runOnSeries() { List<Trade> trades = manager.run(strategy).getTrades(); assertEquals(2, trades.size()); assertEquals(Order.buyAt(2, seriesForRun.getBar(2).getClosePrice(), numOf(1)), trades.get(0).getEntry()); assertEquals(Order.sellAt(4, seriesForRun.getBar(4).getClosePrice(), numOf(1)), trades.get(0).getExit()); assertEquals(Order.buyAt(6, seriesForRun.getBar(6).getClosePrice(), numOf(1)), trades.get(1).getEntry()); assertEquals(Order.sellAt(7, seriesForRun.getBar(7).getClosePrice(), numOf(1)), trades.get(1).getExit()); }
public TradingRecord run(Strategy strategy) { return run(strategy, OrderType.BUY); }
BarSeriesManager { public TradingRecord run(Strategy strategy) { return run(strategy, OrderType.BUY); } }
BarSeriesManager { public TradingRecord run(Strategy strategy) { return run(strategy, OrderType.BUY); } BarSeriesManager();  BarSeriesManager(BarSeries barSeries);  BarSeriesManager(BarSeries barSeries, CostModel transactionCostModel, CostModel holdingCostModel); }
BarSeriesManager { public TradingRecord run(Strategy strategy) { return run(strategy, OrderType.BUY); } BarSeriesManager();  BarSeriesManager(BarSeries barSeries);  BarSeriesManager(BarSeries barSeries, CostModel transactionCostModel, CostModel holdingCostModel); void setBarSeries(BarSeries barSeries); BarSeries getBarSeries(); TradingRecord run(Strategy strategy); TradingRecord run(Strategy strategy, int startIndex, int finishIndex); TradingRecord run(Strategy strategy, OrderType orderType); TradingRecord run(Strategy strategy, OrderType orderType, int startIndex, int finishIndex); TradingRecord run(Strategy strategy, OrderType orderType, Num amount); TradingRecord run(Strategy strategy, OrderType orderType, Num amount, int startIndex, int finishIndex); }
BarSeriesManager { public TradingRecord run(Strategy strategy) { return run(strategy, OrderType.BUY); } BarSeriesManager();  BarSeriesManager(BarSeries barSeries);  BarSeriesManager(BarSeries barSeries, CostModel transactionCostModel, CostModel holdingCostModel); void setBarSeries(BarSeries barSeries); BarSeries getBarSeries(); TradingRecord run(Strategy strategy); TradingRecord run(Strategy strategy, int startIndex, int finishIndex); TradingRecord run(Strategy strategy, OrderType orderType); TradingRecord run(Strategy strategy, OrderType orderType, int startIndex, int finishIndex); TradingRecord run(Strategy strategy, OrderType orderType, Num amount); TradingRecord run(Strategy strategy, OrderType orderType, Num amount, int startIndex, int finishIndex);  }