@Test public void calculateOpenSellTrade() { int currentIndex = 4; Trade trade = new Trade(Order.OrderType.BUY, transactionModel, new ZeroCostModel()); trade.operate(0, DoubleNum.valueOf(100), DoubleNum.valueOf(1)); Num costsFromModel = transactionModel.calculate(trade, currentIndex); assertNumEquals(costsFromModel, DoubleNum.valueOf(1)); }
public Num calculate(Trade trade, int currentIndex) { return this.calculate(trade); }
LinearTransactionCostModel implements CostModel { public Num calculate(Trade trade, int currentIndex) { return this.calculate(trade); } }
LinearTransactionCostModel implements CostModel { public Num calculate(Trade trade, int currentIndex) { return this.calculate(trade); } LinearTransactionCostModel(double feePerTrade); }
LinearTransactionCostModel implements CostModel { public Num calculate(Trade trade, int currentIndex) { return this.calculate(trade); } LinearTransactionCostModel(double feePerTrade); Num calculate(Trade trade, int currentIndex); Num calculate(Trade trade); Num calculate(Num price, Num amount); boolean equals(CostModel otherModel); }
LinearTransactionCostModel implements CostModel { public Num calculate(Trade trade, int currentIndex) { return this.calculate(trade); } LinearTransactionCostModel(double feePerTrade); Num calculate(Trade trade, int currentIndex); Num calculate(Trade trade); Num calculate(Num price, Num amount); boolean equals(CostModel otherModel);  }