persistable sclass ROCIndicator extends CandleBasedIndicator { // ROC values collected as ticker gettable TickerSequence rocHistory = new TickerSequence("ROC"); // ATR value settable double roc = Double.NaN; Double value() { ret roc(); } *(int *length) {} { length = 10; onCandleAdded((IVF1) candle -> { if (l(candles()) >= length) { roc(asPercentIncrease(candle.close(), candles().first().close())); long time = candle.endTime().toLong(); rocHistory?.addIfPriceChanged(roc, time); } }); } TickerSequence asTicker(L candles) { feed(candles); ret rocHistory; } void reset :: after { resetFields(this, "roc rocHistory"); } }