@Test public void calculateWithNoTrades() { MockTimeSeries series = new MockTimeSeries(1, 2, 3, 6, 5, 20, 3); MaximumDrawdownCriterion mdd = new MaximumDrawdownCriterion(); assertEquals(0d, mdd.calculate(series, new BaseTradingRecord()), TATestsUtils.TA_OFFSET); }
@Override public double calculate(TimeSeries series, TradingRecord tradingRecord) { CashFlow cashFlow = new CashFlow(series, tradingRecord); Decimal maximumDrawdown = calculateMaximumDrawdown(series, cashFlow); return maximumDrawdown.toDouble(); }
MaximumDrawdownCriterion extends AbstractAnalysisCriterion { @Override public double calculate(TimeSeries series, TradingRecord tradingRecord) { CashFlow cashFlow = new CashFlow(series, tradingRecord); Decimal maximumDrawdown = calculateMaximumDrawdown(series, cashFlow); return maximumDrawdown.toDouble(); } }
MaximumDrawdownCriterion extends AbstractAnalysisCriterion { @Override public double calculate(TimeSeries series, TradingRecord tradingRecord) { CashFlow cashFlow = new CashFlow(series, tradingRecord); Decimal maximumDrawdown = calculateMaximumDrawdown(series, cashFlow); return maximumDrawdown.toDouble(); }  }
MaximumDrawdownCriterion extends AbstractAnalysisCriterion { @Override public double calculate(TimeSeries series, TradingRecord tradingRecord) { CashFlow cashFlow = new CashFlow(series, tradingRecord); Decimal maximumDrawdown = calculateMaximumDrawdown(series, cashFlow); return maximumDrawdown.toDouble(); }  @Override double calculate(TimeSeries series, TradingRecord tradingRecord); @Override double calculate(TimeSeries series, Trade trade); @Override boolean betterThan(double criterionValue1, double criterionValue2); }
MaximumDrawdownCriterion extends AbstractAnalysisCriterion { @Override public double calculate(TimeSeries series, TradingRecord tradingRecord) { CashFlow cashFlow = new CashFlow(series, tradingRecord); Decimal maximumDrawdown = calculateMaximumDrawdown(series, cashFlow); return maximumDrawdown.toDouble(); }  @Override double calculate(TimeSeries series, TradingRecord tradingRecord); @Override double calculate(TimeSeries series, Trade trade); @Override boolean betterThan(double criterionValue1, double criterionValue2);  }