AccumulativeSwingIndex


Summary

A variation on Wilder's swing index which plots an accumulation of the swing index value of each candlestick or bar.

Remarks

The accumulative swing index is used to gain a longer-term picture than the Wilder's swing index. When the accumulative swing index is positive, the long-term trend is up. When the accumulative swing index is negative, it signals a downwards long-term trend.

Syntax

public interface AccumulativeSwingIndex

Members

NameTypeSummary
Result PropertyThe time series of AccumulativeSwingIndex.

Example 1

using cAlgo.API;
using cAlgo.API.Indicators;
namespace cAlgo.Indicator
{
    [Indicator]
    public class AccumSwingIndexReferenceExample:Indicator
    {
        private AccumulativeSwingIndex _accumulativeSwingIndex;
        [Parameter("Limit Move", DefaultValue = 12)]
        public int LimitMove { get; set; }
        [Output("Main")]
        public IndicatorDataSeries Result { get; set; }
        protected override void Initialize()
        {
            _accumulativeSwingIndex = Indicators.AccumulativeSwingIndex(LimitMove);
        }
        public override void Calculate(int index)
        {
            // Display Result of Indicator
            Result[index] = _accumulativeSwingIndex.Result[index];
        }
    }
}