Accumulation Distribution Line (ADL) free
Developed by Marc Chaikin, the Accumulation Distribution Line is a volume-based indicator designed to measure the cumulative flow of money into and out of a security. Chaikin originally referred to the indicator as the Cumulative Money Flow Line. As with cumulative indicators, the Accumulation Distribution Line is a running total of each period's Money Flow Volume. First, a multiplier is calculated based on the relationship of the close to the high-low range. Second, the Money Flow Multiplier is multiplied by the period's volume to come up with a Money Flow Volume. A running total of the Money Flow Volume forms the Accumulation Distribution Line. Chartists can use this indicator to affirm a security's underlying trend or anticipate reversals when the indicator diverges from the security price.
Github: GitHub - Doustzadeh/cTrader-Indicator
using cAlgo.API; namespace cAlgo { [Indicator(IsOverlay = false, AccessRights = AccessRights.None)] public class AccumulationDistributionLine : Indicator { [Output("ADL", LineColor = "Red")] public IndicatorDataSeries ADL { get; set; } // 1. Money Flow Multiplier = [(Close - Low) - (High - Close)] / (High - Low) // 2. Money Flow Volume = Money Flow Multiplier x Volume for the Period // 3. ADL = Previous ADL + Current Period's Money Flow Volume private double High, Low, Close, Volume, MFM, MFV; public override void Calculate(int index) { // High = High price for the period // Low = Low price for the period // Close = Closing price // Volume = Volume for the Period // MFM = Money Flow Multiplier // MFV = Money Flow Volume if (index < 1) { ADL[index] = 0; return; } High = Bars.HighPrices[index]; Low = Bars.LowPrices[index]; Close = Bars.ClosePrices[index]; Volume = Bars.TickVolumes[index]; MFM = High - Low == 0 ? 0 : ((Close - Low) - (High - Close)) / (High - Low); MFV = MFM * Volume; ADL[index] = ADL[index - 1] + MFV; } } }