@Test public void dummyData() { MockBarSeries series = new MockBarSeries(numFunction, 100, 150, 200, 100, 50, 100); TradingRecord tradingRecord = new BaseTradingRecord(); Num criterion; tradingRecord.operate(0); tradingRecord.operate(1); criterion = getCriterion(1000d, 0.005, 0.2).calculate(series, tradingRecord); assertNumEquals(12.861, criterion); tradingRecord.operate(2); tradingRecord.operate(3); criterion = getCriterion(1000d, 0.005, 0.2).calculate(series, tradingRecord); assertNumEquals(24.3759, criterion); tradingRecord.operate(5); criterion = getCriterion(1000d, 0.005, 0.2).calculate(series, tradingRecord); assertNumEquals(28.2488, criterion); }
@Override public Num calculate(BarSeries series, Trade trade) { return getTradeCost(series, trade, series.numOf(initialAmount)); }
LinearTransactionCostCriterion extends AbstractAnalysisCriterion { @Override public Num calculate(BarSeries series, Trade trade) { return getTradeCost(series, trade, series.numOf(initialAmount)); } }
LinearTransactionCostCriterion extends AbstractAnalysisCriterion { @Override public Num calculate(BarSeries series, Trade trade) { return getTradeCost(series, trade, series.numOf(initialAmount)); } LinearTransactionCostCriterion(double initialAmount, double a);  LinearTransactionCostCriterion(double initialAmount, double a, double b); }
LinearTransactionCostCriterion extends AbstractAnalysisCriterion { @Override public Num calculate(BarSeries series, Trade trade) { return getTradeCost(series, trade, series.numOf(initialAmount)); } LinearTransactionCostCriterion(double initialAmount, double a);  LinearTransactionCostCriterion(double initialAmount, double a, double b); @Override Num calculate(BarSeries series, Trade trade); @Override Num calculate(BarSeries series, TradingRecord tradingRecord); @Override boolean betterThan(Num criterionValue1, Num criterionValue2); }
LinearTransactionCostCriterion extends AbstractAnalysisCriterion { @Override public Num calculate(BarSeries series, Trade trade) { return getTradeCost(series, trade, series.numOf(initialAmount)); } LinearTransactionCostCriterion(double initialAmount, double a);  LinearTransactionCostCriterion(double initialAmount, double a, double b); @Override Num calculate(BarSeries series, Trade trade); @Override Num calculate(BarSeries series, TradingRecord tradingRecord); @Override boolean betterThan(Num criterionValue1, Num criterionValue2);  }