Topics
14 Apr 2020, 13:28
 1563
 3
Replies

einrel.lernie
29 Apr 2020, 19:41 ( Updated at: 21 Dec 2023, 09:22 )

RE: RE:

I'm looking for this highlight as well. Is there any property for this? Even if its not related to the lines will do.

Or maybe some tooltips?

 

Thanks.

 

johnreygalax8 said:

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)
        {
        }
    }
}


 

 

 


@einrel.lernie

einrel.lernie
13 Apr 2020, 16:49 ( Updated at: 21 Dec 2023, 09:22 )

RE:

PanagiotisCharalampous said:

Hi einrel.lernie,

You can check the Maximum and Minimum methods.

Best Regards,

Panagiotis 

Join us on Telegram

I think im not clear enough, what i mean is from the previous Period Separator, which defaults 24 candles.

Like in my picture, the high and low of the previous 2 Period separator.

I cant just use MarketSeries.High.Maximum(48), since the current period separator is moving dynamically.

Or maybe what i could use is a function or property to count the bars on the current period separtor.

 

thanks

 


@einrel.lernie