Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Global Draw Object
Collapse
X
-
Hello cryfgg,
Thanks for your post.
We do not offer any support for global drawing objects on multiple instruments.
The closest you can get would be to add a public method to your indicator that takes a start time and end time, and a start and end price. The method could then use those parameters to call Draw.ArrowLine() with a specific tag to update that arrow line, or draw a new one.
The indicator then would need to be added to all charts that where the arrow line should be draw.
Then, when the indicator should call Draw.ArrowLine(), do this instead: loop through all windows, and within all windows that are charts, loop through the active ChartControl Indicators collection and find your indicator, then call the indicator's public method and give it the start/end price/time parameters. (I would only attempt to modify things on other windows after State == State.Realtime)
Here is some code to loop through windows and loop through indicators in the ActiveChartControl Indicators collection.
Draw.ArrowLine() - https://ninjatrader.com/support/help..._arrowline.htmCode:foreach (var window in NinjaTrader.Core.Globals.AllWindows) { // check if the found window is a Chart window, if not continue looking if (!(window is NinjaTrader.Gui.Chart.Chart)) continue; window.Dispatcher.InvokeAsync(new Action(() => { // try to cast as a Chart, if it fails it will be null var foundChart = window as NinjaTrader.Gui.Chart.Chart; // make sure we found a chart if (foundChart == null) return; // make sure the found chart is the owner window if (foundChart != this.Owner as NinjaTrader.Gui.Chart.Chart) return; // Instantiate indicator collection ChartObjectCollection<NinjaTrader.Gui.NinjaScript. IndicatorRenderBase> indicatorCollection = foundChart.ActiveChartControl.Indicators; // Loop through indicators in collection foreach (Indicator indi in indicatorCollection) Print(indi.Name); })); }
ChartControl.Indicators - https://ninjatrader.com/support/help...indicators.htm
We look forward to assisting.
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
68 views
0 likes
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
150 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
162 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
100 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
288 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|

Comment