@Test public void rewardRiskRatioCriterion() { TradingRecord tradingRecord = new BaseTradingRecord( Order.buyAt(0), Order.sellAt(1), Order.buyAt(2), Order.sellAt(4), Order.buyAt(5), Order.sellAt(7)); MockTimeSeries series = new MockTimeSeries(100, 105, 95, 100, 90, 95, 80, 120); double totalProfit = (105d / 100) * (90d / 95d) * (120d / 95); double peak = (105d / 100) * (100d / 95); double low = (105d / 100) * (90d / 95) * (80d / 95); assertEquals(totalProfit / ((peak - low) / peak), rrc.calculate(series, tradingRecord), TATestsUtils.TA_OFFSET); }
@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);  }