Topics
21 Jul 2018, 11:30
 1447
 4
Replies

johnreygalax8
23 Jul 2018, 18:30 ( Updated at: 21 Dec 2023, 09:20 )

RE:

hi is there a way to highlight the corresponding whole number???

so it will look like this cAlgo_Fanatic said:

Indicator showing Round Numbers based on input step pips calculated between the chart High and Low.

 

Source Code:

using System;
using cAlgo.API;

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = true)]
    public class RoundNumbers : Indicator
    {
        [Parameter(DefaultValue = 100)]
        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.Gray);
            }
        }

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


 

 


@johnreygalax8

johnreygalax8
23 Jul 2018, 17:53

can you help me how to do that. im sorry i dont know anything about programming thanks


@johnreygalax8

johnreygalax8
21 Jul 2018, 11:49

RE:

marty142 said:

Anyone know if there is a rectangle extender available for ctrader?

have you find one???


@johnreygalax8