/// <summary> /// Accumulation/ distribution index as described here: /// <see href="https://en.wikipedia.org/wiki/Accumulation/distribution_index"/> /// </summary> /// <param name="series">input time series</param> /// <param name="parentId">caller cache id, optional</param> /// <param name="memberName">caller's member name, optional</param> /// <param name="lineNumber">caller line number, optional</param> /// <returns>accumulation/ distribution index as time series</returns> public static ITimeSeries <double> AccumulationDistributionIndex(this Instrument series, CacheId parentId = null, [CallerMemberName] string memberName = "", [CallerLineNumber] int lineNumber = 0) { var cacheId = new CacheId(parentId, memberName, lineNumber, series.GetHashCode()); return(IndicatorsBasic.BufferedLambda( (v) => v + series.Volume[0] * series.CLV()[0], 0.0, cacheId)); }