### Question:
LinearlyWeightedMovingAverage extends MultiValueIndicator { @Override public double getValue() { return value; } LinearlyWeightedMovingAverage(TimeInterval interval);  LinearlyWeightedMovingAverage(int length, TimeInterval interval);  LinearlyWeightedMovingAverage(int length, TimeInterval interval, ToDoubleFunction<Candle> valueGetter); @Override double getValue();  }### Answer:
@Test public void lwma() { int i = 0; LinearlyWeightedMovingAverage indicator = new LinearlyWeightedMovingAverage(5, TimeInterval.MINUTE, c -> c.close); indicator.accumulate(CandleHelper.newCandle(i, values[i++])); assertEquals(37.08, indicator.getValue(), 0.001); indicator.accumulate(CandleHelper.newCandle(i, values[i++])); assertEquals(36.826, indicator.getValue(), 0.001); indicator.accumulate(CandleHelper.newCandle(i, values[i++])); assertEquals(36.468, indicator.getValue(), 0.001); indicator.accumulate(CandleHelper.newCandle(i, values[i++])); assertEquals(36.221, indicator.getValue(), 0.001); indicator.accumulate(CandleHelper.newCandle(i, values[i++])); assertEquals(36.0506, indicator.getValue(), 0.001); indicator.accumulate(CandleHelper.newCandle(i, values[i++])); assertEquals(35.9673, indicator.getValue(), 0.001); indicator.accumulate(CandleHelper.newCandle(i, values[i++])); assertEquals(36.0766, indicator.getValue(), 0.001); indicator.accumulate(CandleHelper.newCandle(i, values[i++])); assertEquals(36.6253, indicator.getValue(), 0.001); indicator.accumulate(CandleHelper.newCandle(i, values[i++])); assertEquals(37.1833, indicator.getValue(), 0.001); indicator.accumulate(CandleHelper.newCandle(i, values[i++])); assertEquals(37.5240, indicator.getValue(), 0.001); indicator.accumulate(CandleHelper.newCandle(i, values[i++])); assertEquals(37.4060, indicator.getValue(), 0.001); }