cTrader BUG
Created at 11 Nov 2021, 14:21
cTrader BUG
11 Nov 2021, 14:21
Hello, something in the latest version of ctrader prevents creating objects on the chart to be able to move them with the mouse.
An overload message blocks the following code:
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 Tony_test : Indicator
{
ChartIcon m_point;
protected override void Initialize()
{
Chart.MouseDown += arg =>
{
m_point = Chart.DrawIcon("point_1", ChartIconType.Circle, arg.TimeValue, arg.YValue, Color.Gray);
};
Chart.MouseMove += arg =>
{
if (m_point != null)
{
m_point.Time = arg.TimeValue;
m_point.Y = arg.YValue;
}
};
}
public override void Calculate(int index)
{
// Calculate value at specified index
// Result[index] = ...
}
}
}