mouse move in the indicator area

Created at 20 Mar 2024, 05:03
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!
M2

m261.acosta

Joined 19.01.2024

mouse move in the indicator area
20 Mar 2024, 05:03


Hello friends
How can I know that the mouse is moving in the indicator area? 
And also how to find out the name of the indicator of each area
I found this code but it doesn't seem to work properly

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using cAlgo.API;
using cAlgo.API.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;

namespace cAlgo
{
    [Indicator(AccessRights = AccessRights.None, IsOverlay = true)]
    public class IndicatorAlertManager : Indicator
    {
        [Parameter(DefaultValue = "Hello world!")]
        public string Message { get; set; }

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

        protected override void Initialize()
        {
            foreach (var element in Chart.IndicatorAreas)
            {
                element.MouseDown += element_MouseDown;
                element.MouseMove += element_MouseMove;
            }

        }

        private void element_MouseMove(ChartMouseEventArgs obj)
        {
            Print(obj.MouseX);
        }

        private void element_MouseDown(ChartMouseEventArgs obj)
        {
            Print(obj.MouseX);
        }
        public override void Calculate(int index)
        {
            // Calculate value at specified index
            // Result[index] = 
        }
    }
}

 


@m261.acosta