Code Help

Created at 03 Feb 2018, 20:36
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!
ST

Storm31

Joined 10.10.2016

Code Help
03 Feb 2018, 20:36


Could anyone change this code so that this indicator displays dotted lines? It currently displays bold lines if which clutter the screen.

Thanks in advance to any help given.

 

using System;
using cAlgo.API;

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = true, AccessRights = AccessRights.None)]
    public class RoundNumbers : Indicator
    {
        [Parameter(DefaultValue = 25)]
        public int StepPips { get; set; }

        protected override void Initialize()
        {
            double max = MarketSeries.High.Maximum(MarketSeries.High.Count);
            double min = MarketSeries.Low.Minimum(MarketSeries.Low.Count);

            double step = Symbol.PipSize * StepPips;
            double start = Math.Floor(min / step) * step;

            for (double level = start; level <= max + step; level += step)
            {
                ChartObjects.DrawHorizontalLine("line_" + level, level, Colors.DarkGreen);
            }
        }

        public override void Calculate(int index)
        {
        }
    }
}

 


@Storm31
Replies

PanagiotisCharalampous
05 Feb 2018, 11:39

Hi Storm31,

You can use PlotType to achieve this.

Best Regards,

Panagiotis


@PanagiotisCharalampous