SwingIndex


Summary

Developed by Welles Wilder, the Swing Index compares current Open, high, Low and Close prices to find of current and previous periods to find "real" price.

Syntax

public interface SwingIndex

Members

NameTypeSummary
Result PropertyThe Result Series of the Swing Index Indicator

Example 1

using cAlgo.API;
using cAlgo.API.Indicators;
namespace cAlgo.Indicators
{
    [Indicator]
    public class Test:Indicator
    {
        private SwingIndex _swingIndex;
        [Parameter(DefaultValue = 12)]
        public int LimitMoveValue { get; set; }
        protected override void Initialize()
        {
            _swingIndex = Indicators.SwingIndex(LimitMoveValue);
        }
        
        public override void Calculate(int index)
        {
            //Print the current value of SwingIndex to the log
            Print("The current value of SwingIndex is {0}", _swingIndex.Result[index]);            
        }
    }
}