Advance Decline Line (ADL) free

by qualitiedx2 in category Trend at 25/05/2012
Description

Advance Decline Line indicator is used in Forex to identify and confirm strength of a trend, as well as its chances for reversing. ADL indicator in Forex provides a comparison between the number of market advancing and declining moments for a given period of time!

Advance Decilne

Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.
Formula / Source Code
Language: C#
Trading Platform: cAlgocTrader
using System;
using cAlgo.API;
using cAlgo.API.Indicators;

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = false, AccessRights = AccessRights.None)]
    public class ADL : Indicator
    {
        [Parameter(DefaultValue = 10)]
        public int Period { get; set; }

        [Output("ADL")]
        public IndicatorDataSeries adl { get; set; }

    	int rs;
		int fs;

        public override void Calculate(int index)
        {
        rs=0;
        fs=0;
        if(index<=Period){adl[index]=0;}
        for(int i=0;i<Period;i++)
        {
        	if(MarketSeries.Close[index-i]>MarketSeries.Open[index-i]){rs+=1;}
        	if(MarketSeries.Close[index-i]<MarketSeries.Open[index-i]){fs+=1;}
        }
        if(index>Period){adl[index] = rs - fs + adl[index-1];}
        }
    }
}
Comments
3.33