DiscontinousLine not showing

Created at 17 Dec 2019, 15:37
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
GE

genappsforex

Joined 25.11.2019

DiscontinousLine not showing
17 Dec 2019, 15:37


Making an overlayed indicator but Why is the green line not showing?

using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;

namespace cAlgo
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class TestOsc : Indicator
    {

        [Output("Green", PlotType = PlotType.DiscontinuousLine, LineColor = "FF00FF00")]
        public IndicatorDataSeries GreenSerie { get; set; }

        [Output("Red", PlotType = PlotType.DiscontinuousLine, LineColor = "FF00FF00")]
        public IndicatorDataSeries RedSerie { get; set; }
        double Dist = 0;
        protected override void Initialize()
        {
            Dist = 10 * Symbol.PipValue;
        }

        int previndex = 0;
        public override void Calculate(int index)
        {
            if (previndex == index)
                return;
            previndex = index;
            string line = (3 * Math.Round((double)index / 3, 0) + " == " + index);
            if (3 * Math.Round((double)index / 3, 0) == index)
            {
                GreenSerie[index] = MarketSeries.High.LastValue + Dist;
                line += " GREEN";
            }
            else
            {
                RedSerie[index] = MarketSeries.High.LastValue + Dist;
                line += " RED";
            }
            Print(line);
        }
    }
}


 

Also often DiscontinousLines are not discontinuous in indicators. The start to be discontinous on realtime.
Why is that, and how to overcome.

Hope someone knows.
 


@genappsforex