I would like to ask you for any help. I use NT7. I need to draw a ray on chart within indicator.
I have toolstripbutton and if I press it I want to draw the ray.
I tried to use DrawRay method, it works well. But if I press F5 (reload script) my ray disappers - I dont need it.
So I tried to use other way - code below (item is a my class reference with all values for the ray):
Gui.Chart.ChartRay _chartray = new Gui.Chart.ChartRay();
_chartray.Anchor1Time = item.StartPointTime;
_chartray.Anchor1Y = item.StartPointY;
_chartray.Anchor2Time = item.EndPointTime;
_chartray.Anchor2Y = item.EndPointY;
_chartray.Locked = false;
_chartray.Tag = item.Tag;
_chartray.Selectable = true;
_chartray.VisibleOnInstrument = Instrument.FullName;
ChartControl.ChartObjects.Add(_chartray);
It works perfect and the ray is on the same place after reload. But it is not possible to move it manually from chart. It is not locked, but it behaves like it is. If I open contextmenu and Properties... and then pres OK, ray movements are possible.
I know this is out of your support, but PLEASE help me somehow. It must be some trick to do that.
Comment