I've created a drawing tool that draws a zone. The tool is derived from the RegionHighlightBase.
When I attach the tool to All Charts and try to move it around the chart, the screen freeze for many seconds, and under the log screen, I see the message:
"Error on getting/setting property 'InitialMouseDownAnchor' for NinjaScript 'Zone': Exception has been thrown by the target of an invocation."
If I change the Attach To property to just the current chart, there is no problem.
Can you think of a reason this happens?
Below is the code:
public override void OnMouseMove(ChartControl chartControl, ChartPanel chartPanel, ChartScale chartScale, ChartAnchor dataPoint)
{
base.OnMouseMove(chartControl, chartPanel, chartScale, dataPoint);
StartAnchor.Price = Math.Round(StartAnchor.Price * 4, MidpointRounding.ToEven) / 4;
EndAnchor.Price = Math.Round(EndAnchor.Price * 4, MidpointRounding.ToEven) / 4;
Tag = String.Format("@Z {0:0.00}-{1:0.00}", Math.Round(StartAnchor.Price * 4, MidpointRounding.ToEven) / 4, Math.Round(EndAnchor.Price * 4, MidpointRounding.ToEven) / 4);
if (StartAnchor.Price != lastStartAnchorPrice || EndAnchor.Price != lastEndAnchorPrice)
{
if (lastEndAnchorPrice != 0 && disableUponMove)
{
Active = false;
}
lastStartAnchorPrice = StartAnchor.Price;
lastEndAnchorPrice = EndAnchor.Price;
}
}

Comment