@Test public void cashFlowValueWithOnlyOneTradeAndAGapBefore() { BarSeries sampleBarSeries = new MockBarSeries(numFunction, 1d, 1d, 2d); TradingRecord tradingRecord = new BaseTradingRecord(Order.buyAt(1, sampleBarSeries), Order.sellAt(2, sampleBarSeries)); CashFlow cashFlow = new CashFlow(sampleBarSeries, tradingRecord); assertNumEquals(1, cashFlow.getValue(0)); assertNumEquals(1, cashFlow.getValue(1)); assertNumEquals(2, cashFlow.getValue(2)); }
@Override public Num getValue(int index) { return values.get(index); }
CashFlow implements Indicator<Num> { @Override public Num getValue(int index) { return values.get(index); } }
CashFlow implements Indicator<Num> { @Override public Num getValue(int index) { return values.get(index); } CashFlow(BarSeries barSeries, Trade trade);  CashFlow(BarSeries barSeries, TradingRecord tradingRecord);  CashFlow(BarSeries barSeries, TradingRecord tradingRecord, int finalIndex); }
CashFlow implements Indicator<Num> { @Override public Num getValue(int index) { return values.get(index); } CashFlow(BarSeries barSeries, Trade trade);  CashFlow(BarSeries barSeries, TradingRecord tradingRecord);  CashFlow(BarSeries barSeries, TradingRecord tradingRecord, int finalIndex); @Override Num getValue(int index); @Override BarSeries getBarSeries(); @Override Num numOf(Number number); int getSize(); }
CashFlow implements Indicator<Num> { @Override public Num getValue(int index) { return values.get(index); } CashFlow(BarSeries barSeries, Trade trade);  CashFlow(BarSeries barSeries, TradingRecord tradingRecord);  CashFlow(BarSeries barSeries, TradingRecord tradingRecord, int finalIndex); @Override Num getValue(int index); @Override BarSeries getBarSeries(); @Override Num numOf(Number number); int getSize();  }