I have been hard at work trying to come up with a workaround that attaches indicator drawn objects to the chart. The solution is not 100% and there are two major flaws.
1. If an object is not moved around before the indicator is removed, moving the object once the indicator is removed makes the object jumped to the beginning of the chart.
2. It doesn't seem possible to set an object to global.
// text is a Draw.Text() object text.DrawnBy = null; text.IsLocked = false; NinjaTrader.NinjaScript.DrawingTools.DrawingToolAttachedTo newAttachedTo = new NinjaTrader.NinjaScript.DrawingTools.DrawingToolAttachedTo(); newAttachedTo.ChartObject = ChartBars; newAttachedTo.Instrument = this.Instrument; // AttachedToType cannot be change is the limitation to the workwround // attachedToObject.AttachedToType = AttachedToType.GlobalInstrument; text.AttachedTo = newAttachedTo; ForceRefresh();
Hope this helps
Comment