fix max and min in indicator area

khoshroomahdi's avatar

khoshroomahdi since: 17 Jun 2021;

  08 Aug 2021, 17:44
fix max and min in indicator area

i want to fix min and max indicator windwos. like metatrader.

for ex: in stochastic i want to have 0 and 100 even when i zoom chart. because when i zoom chart for exmaple indicator area max and min changed.

i try this code but nothing happend.

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

namespace cAlgo
{
    [Indicator(IsOverlay = false, AutoRescale = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class NewIndicator : Indicator
    {
        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }

        [Output("RSI", Color = Colors.Blue)]
        public IndicatorDataSeries Result { get; set; }
        [Output("K", Color = Colors.Green)]
        public IndicatorDataSeries K { get; set; }
        [Output("D", Color = Colors.Red)]
        public IndicatorDataSeries D { get; set; }

        private RelativeStrengthIndex _rsi;
        private StochasticOscillator _stochasticOscillator;

        protected override void Initialize()
        {
            _rsi = Indicators.RelativeStrengthIndex(MarketSeries.High, 14);
            _stochasticOscillator = Indicators.StochasticOscillator(9, 3, 9, MovingAverageType.Simple);
            IndicatorArea.SetYRange(0, 100);

        }

        public override void Calculate(int index)
        {
            Result[index] = _rsi.Result[index];
            K[index] = _stochasticOscillator.PercentK[index];
            D[index] = _stochasticOscillator.PercentD[index];
            IndicatorArea.SetYRange(0, 100);
        }
    }
}

PanagiotisCharalampous's avatar

PanagiotisCharalampous since: 13 Jan 2017;

  09 Aug 2021, 08:43

Hi khoshroomahdi,

There is no such option at the moment.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

Head of Community Management at cTrader