@Test public void runBetweenIndexes() { List<Trade> trades = manager.run(strategy, 0, 3).getTrades(); assertEquals(1, trades.size()); assertEquals(Order.buyAt(2, seriesForRun.getTick(2).getClosePrice(), Decimal.NaN), trades.get(0).getEntry()); assertEquals(Order.sellAt(4, seriesForRun.getTick(4).getClosePrice(), Decimal.NaN), trades.get(0).getExit()); trades = manager.run(strategy, 4, 4).getTrades(); assertTrue(trades.isEmpty()); trades = manager.run(strategy, 5, 8).getTrades(); assertEquals(1, trades.size()); assertEquals(Order.buyAt(6, seriesForRun.getTick(6).getClosePrice(), Decimal.NaN), trades.get(0).getEntry()); assertEquals(Order.sellAt(7, seriesForRun.getTick(7).getClosePrice(), Decimal.NaN), trades.get(0).getExit()); }
public TradingRecord run(Strategy strategy) { return run(strategy, OrderType.BUY); }
TimeSeriesManager { public TradingRecord run(Strategy strategy) { return run(strategy, OrderType.BUY); } }
TimeSeriesManager { public TradingRecord run(Strategy strategy) { return run(strategy, OrderType.BUY); } TimeSeriesManager();  TimeSeriesManager(TimeSeries timeSeries); }
TimeSeriesManager { public TradingRecord run(Strategy strategy) { return run(strategy, OrderType.BUY); } TimeSeriesManager();  TimeSeriesManager(TimeSeries timeSeries); void setTimeSeries(TimeSeries timeSeries); TimeSeries getTimeSeries(); 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, Decimal amount); TradingRecord run(Strategy strategy, OrderType orderType, Decimal amount, int startIndex, int finishIndex); }
TimeSeriesManager { public TradingRecord run(Strategy strategy) { return run(strategy, OrderType.BUY); } TimeSeriesManager();  TimeSeriesManager(TimeSeries timeSeries); void setTimeSeries(TimeSeries timeSeries); TimeSeries getTimeSeries(); 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, Decimal amount); TradingRecord run(Strategy strategy, OrderType orderType, Decimal amount, int startIndex, int finishIndex);  }