cTrader BUG

Created at 11 Nov 2021, 14:21
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!
bienve.pf's avatar

bienve.pf

Joined 19.09.2018

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] = ...
        }
    }
}

 


@bienve.pf