mouse move in the indicator area
Created at 20 Mar 2024, 05:03
M2
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] =
}
}
}