@Test public void calculateWithNoTrades() { MockTimeSeries series = new MockTimeSeries(100, 105, 110, 100, 95, 105); AnalysisCriterion numberOfTicks = new NumberOfTicksCriterion(); assertEquals(0, (int) numberOfTicks.calculate(series, new BaseTradingRecord())); }
@Override public double calculate(TimeSeries series, TradingRecord tradingRecord) { int nTicks = 0; for (Trade trade : tradingRecord.getTrades()) { nTicks += calculate(series, trade); } return nTicks; }
NumberOfTicksCriterion extends AbstractAnalysisCriterion { @Override public double calculate(TimeSeries series, TradingRecord tradingRecord) { int nTicks = 0; for (Trade trade : tradingRecord.getTrades()) { nTicks += calculate(series, trade); } return nTicks; } }
NumberOfTicksCriterion extends AbstractAnalysisCriterion { @Override public double calculate(TimeSeries series, TradingRecord tradingRecord) { int nTicks = 0; for (Trade trade : tradingRecord.getTrades()) { nTicks += calculate(series, trade); } return nTicks; }  }
NumberOfTicksCriterion extends AbstractAnalysisCriterion { @Override public double calculate(TimeSeries series, TradingRecord tradingRecord) { int nTicks = 0; for (Trade trade : tradingRecord.getTrades()) { nTicks += calculate(series, trade); } return nTicks; }  @Override double calculate(TimeSeries series, TradingRecord tradingRecord); @Override double calculate(TimeSeries series, Trade trade); @Override boolean betterThan(double criterionValue1, double criterionValue2); }
NumberOfTicksCriterion extends AbstractAnalysisCriterion { @Override public double calculate(TimeSeries series, TradingRecord tradingRecord) { int nTicks = 0; for (Trade trade : tradingRecord.getTrades()) { nTicks += calculate(series, trade); } return nTicks; }  @Override double calculate(TimeSeries series, TradingRecord tradingRecord); @Override double calculate(TimeSeries series, Trade trade); @Override boolean betterThan(double criterionValue1, double criterionValue2);  }