@Test public void withOneTrade() { Trade trade = new Trade(Order.buyAt(0), Order.sellAt(1)); MockTimeSeries series = new MockTimeSeries(100, 95, 95, 100, 90, 95, 80, 120); RewardRiskRatioCriterion ratioCriterion = new RewardRiskRatioCriterion(); assertEquals((95d/100) / ((1d - 0.95d)), TATestsUtils.TA_OFFSET, ratioCriterion.calculate(series, trade)); }
@Override public double calculate(TimeSeries series, TradingRecord tradingRecord) { return totalProfit.calculate(series, tradingRecord) / maxDrawdown.calculate(series, tradingRecord); }
RewardRiskRatioCriterion extends AbstractAnalysisCriterion { @Override public double calculate(TimeSeries series, TradingRecord tradingRecord) { return totalProfit.calculate(series, tradingRecord) / maxDrawdown.calculate(series, tradingRecord); } }
RewardRiskRatioCriterion extends AbstractAnalysisCriterion { @Override public double calculate(TimeSeries series, TradingRecord tradingRecord) { return totalProfit.calculate(series, tradingRecord) / maxDrawdown.calculate(series, tradingRecord); }  }
RewardRiskRatioCriterion extends AbstractAnalysisCriterion { @Override public double calculate(TimeSeries series, TradingRecord tradingRecord) { return totalProfit.calculate(series, tradingRecord) / maxDrawdown.calculate(series, tradingRecord); }  @Override double calculate(TimeSeries series, TradingRecord tradingRecord); @Override boolean betterThan(double criterionValue1, double criterionValue2); @Override double calculate(TimeSeries series, Trade trade); }
RewardRiskRatioCriterion extends AbstractAnalysisCriterion { @Override public double calculate(TimeSeries series, TradingRecord tradingRecord) { return totalProfit.calculate(series, tradingRecord) / maxDrawdown.calculate(series, tradingRecord); }  @Override double calculate(TimeSeries series, TradingRecord tradingRecord); @Override boolean betterThan(double criterionValue1, double criterionValue2); @Override double calculate(TimeSeries series, Trade trade);  }