BUG: Scroll events are wrongly fired constantly

Created at 17 Apr 2019, 07:17
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!
Waxy's avatar

Waxy

Joined 12.05.2015

BUG: Scroll events are wrongly fired constantly
17 Apr 2019, 07:17


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 ScrollBug : Indicator
    {
        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }

        [Output("Main")]
        public IndicatorDataSeries Result { get; set; }


        protected override void Initialize()
        {
            Chart.ScrollChanged += OnChartScrollChanged;
        }
        
        void OnChartScrollChanged(ChartScrollEventArgs obj)
        {
            Print("Scroll Changed");
        }

        public override void Calculate(int index)
        {
            // Calculate value at specified index
            // Result[index] = ...
        }
    }
}

 


@Waxy
Replies

PanagiotisCharalampous
18 Apr 2019, 21:53

Hi Xavier R,

Can you please elaborate on what is the issue?

Best Regards,

Panagiotis


@PanagiotisCharalampous

Waxy
18 Apr 2019, 23:08 ( Updated at: 21 Dec 2023, 09:21 )

Hello Panagiotis,

I apologize, let me explain:

It is supposed that this event is fired every time you scroll through the chart, right?, however, it's being fired constantly without any interaction with the chart whatsoever, it's a bit erratic, I'm not sure what triggers it.


@Waxy