Topics

Forum Topics not found

Replies

seyhaan
16 Sep 2017, 21:38

RE:

Spotware said:

Please have a look at the following code snippet:

        ZigZag zigzag;

        protected override void OnStart()
        {
            zigzag = Indicators.GetIndicator<ZigZag>(12, 5, 3);
        }

        double GetZigZagValue(DataSeries dataSeries, int indexFromEnd)
        {
            for (var i = MarketSeries.Close.Count - 1; i >= 0; i--)
            {
                if (!double.IsNaN(zigzag.Result[i]))
                {
                    if (indexFromEnd == 0)
                        return zigzag.Result[i];
                    indexFromEnd--;
                }
            }
            return double.NaN;
        }

        protected override void OnTick()
        {
            var lastValue = GetZigZagValue(zigzag.Result, 0);
            var previousValue = GetZigZagValue(zigzag.Result, 1);

            if (lastValue > previousValue)
                Print("lastValue {0} > previousValue {1}", lastValue, previousValue);
            if (lastValue < previousValue)
                Print("lastValue {0} < previousValue {1}", lastValue, previousValue);
        }

Hi!

I m very new on zig zag indicator. I have different programme which is based on c# but I could not working out your codes. (visit here, http://estore.directfn.com.tr/ReadMore.aspx?rmc=ideal).  So what can I do?

 


@seyhaan