@Test public void calculateWithOnlyGains() { MockBarSeries series = new MockBarSeries(numFunction, 1, 2, 3, 6, 8, 20, 3); AnalysisCriterion mdd = getCriterion(); TradingRecord tradingRecord = new BaseTradingRecord(Order.buyAt(0, series), Order.sellAt(1, series), Order.buyAt(2, series), Order.sellAt(5, series)); assertNumEquals(0d, mdd.calculate(series, tradingRecord)); }
@Override public Num calculate(BarSeries series, TradingRecord tradingRecord) { CashFlow cashFlow = new CashFlow(series, tradingRecord); return calculateMaximumDrawdown(series, cashFlow); }
MaximumDrawdownCriterion extends AbstractAnalysisCriterion { @Override public Num calculate(BarSeries series, TradingRecord tradingRecord) { CashFlow cashFlow = new CashFlow(series, tradingRecord); return calculateMaximumDrawdown(series, cashFlow); } }
MaximumDrawdownCriterion extends AbstractAnalysisCriterion { @Override public Num calculate(BarSeries series, TradingRecord tradingRecord) { CashFlow cashFlow = new CashFlow(series, tradingRecord); return calculateMaximumDrawdown(series, cashFlow); }  }
MaximumDrawdownCriterion extends AbstractAnalysisCriterion { @Override public Num calculate(BarSeries series, TradingRecord tradingRecord) { CashFlow cashFlow = new CashFlow(series, tradingRecord); return calculateMaximumDrawdown(series, cashFlow); }  @Override Num calculate(BarSeries series, TradingRecord tradingRecord); @Override Num calculate(BarSeries series, Trade trade); @Override boolean betterThan(Num criterionValue1, Num criterionValue2); }
MaximumDrawdownCriterion extends AbstractAnalysisCriterion { @Override public Num calculate(BarSeries series, TradingRecord tradingRecord) { CashFlow cashFlow = new CashFlow(series, tradingRecord); return calculateMaximumDrawdown(series, cashFlow); }  @Override Num calculate(BarSeries series, TradingRecord tradingRecord); @Override Num calculate(BarSeries series, Trade trade); @Override boolean betterThan(Num criterionValue1, Num criterionValue2);  }