@Test public void calculateOnlyWithGainTrades() { series = new MockBarSeries(numFunction, 100d, 105d, 106d, 107d, 108d, 115d); TradingRecord tradingRecord = new BaseTradingRecord(Order.buyAt(0, series), Order.sellAt(2, series), Order.buyAt(3, series), Order.sellAt(5, series)); AnalysisCriterion varCriterion = getCriterion(); assertNumEquals(numOf(0.0), varCriterion.calculate(series, tradingRecord)); }
@Override public Num calculate(BarSeries series, TradingRecord tradingRecord) { Returns returns = new Returns(series, tradingRecord, Returns.ReturnType.LOG); return calculateES(returns, confidence); }
ExpectedShortfallCriterion extends AbstractAnalysisCriterion { @Override public Num calculate(BarSeries series, TradingRecord tradingRecord) { Returns returns = new Returns(series, tradingRecord, Returns.ReturnType.LOG); return calculateES(returns, confidence); } }
ExpectedShortfallCriterion extends AbstractAnalysisCriterion { @Override public Num calculate(BarSeries series, TradingRecord tradingRecord) { Returns returns = new Returns(series, tradingRecord, Returns.ReturnType.LOG); return calculateES(returns, confidence); } ExpectedShortfallCriterion(Double confidence); }
ExpectedShortfallCriterion extends AbstractAnalysisCriterion { @Override public Num calculate(BarSeries series, TradingRecord tradingRecord) { Returns returns = new Returns(series, tradingRecord, Returns.ReturnType.LOG); return calculateES(returns, confidence); } ExpectedShortfallCriterion(Double confidence); @Override Num calculate(BarSeries series, TradingRecord tradingRecord); @Override Num calculate(BarSeries series, Trade trade); @Override boolean betterThan(Num criterionValue1, Num criterionValue2); }
ExpectedShortfallCriterion extends AbstractAnalysisCriterion { @Override public Num calculate(BarSeries series, TradingRecord tradingRecord) { Returns returns = new Returns(series, tradingRecord, Returns.ReturnType.LOG); return calculateES(returns, confidence); } ExpectedShortfallCriterion(Double confidence); @Override Num calculate(BarSeries series, TradingRecord tradingRecord); @Override Num calculate(BarSeries series, Trade trade); @Override boolean betterThan(Num criterionValue1, Num criterionValue2);  }