Thank you!
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to make drawing objects created by an indicator appear globally, on all charts
Collapse
X
-
How to make drawing objects created by an indicator appear globally, on all charts
Q is in the topic, looking for a way to make the drawing objects created in an indicator appear globally, on all charts for that instrument. Is this possible with chart options alone? And separately how can I make this a click able option in the indicator selection in the indicator window, like one of those checkboxes that appears for some.
Thank you!Last edited by Austiner87; 05-06-2024, 05:55 AM.Tags: None
-
Hello,
To make drawing objects created by an indicator appear globally on all charts for that instrument in NinjaTrader, you'll need to handle this programmatically within your indicator's code. NinjaTrader doesn't provide a built-in chart option to share drawing objects across different charts automatically.
Here’s how you can achieve global visibility for drawing objects:- Global Drawing Objects: When creating drawing objects in your NinjaScript code, use the IsGlobal property of the drawing object and set it to true. This makes the drawing visible on all charts of the same instrument.
Here is an example of how you can create a global line:
This code snippet creates a line that appears on all charts with the same instrument as the one where the indicator is applied.Code:Draw.Line(this, "myLine", true, 10, High[10], 0, Low[0], Brushes.Red, DashStyleHelper.Solid, 2).IsGlobal = true;
- Configurable Option in Indicator Window: To allow users to enable or disable the global visibility of drawing objects via a checkbox in the indicator's UI, you'll need to add a public property to your indicator and use it to control the IsGlobal property of your drawing objects.
Here’s a basic example:
In this code, GlobalDrawings is a property that can be toggled in the indicator settings. Its value determines whether the line is drawn globally.Code:[Browsable(true), Category("Parameters")] public bool GlobalDrawings { get; set; } protected override void OnBarUpdate() { if (CurrentBar < 20) return; var line = Draw.Line(this, "myLine" + CurrentBar, true, 10, High[10], 0, Low[0], Brushes.Blue, DashStyleHelper.Solid, 2); line.IsGlobal = GlobalDrawings; }
By adding this property and using it within your indicator, users can control the global visibility of the drawing objects directly from the indicator settings in the NinjaTrader UI.
-
Hi Ryan,
I am trying to use your suggestion, but I am getting a message that HorizontalLine does not contain a definition for 'IsGlobal' and no accessible extension method 'IsGlobal' accepting a first argument of 'HorizontalLine' could be found..."
Did this come about in a recent release? I'm on 8.1.2.1.
If it is a recent development, any way to do it circa 8.1.2.1?
Thanks
Comment
-
Originally posted by NinjaTrader_RyanS View PostHere’s a basic example:
Code:protected override void OnBarUpdate() { if (CurrentBar < 20) return; var line = Draw.Line(this, "myLine" + CurrentBar, true, 10, High[10], 0, Low[0], Brushes.Blue, DashStyleHelper.Solid, 2); line.IsGlobal = true; }
This is not available in version 8.0.28.0 and below!
Is this something new, introduced in the newest version?
Comment
-
Neither way can be used to change the global status of any drawn object, not too or from.Originally posted by NinjaTrader_ChelseaB View PostI think what you are looking for is .IsGlobalDrawingTool.
Please correct me if I'm wrong, as I would love to be wrong here! Been waiting years!
How to and "Only" current way to Change a Draw Objects Global Status:
1.) A Script drawn object needs completely Re-Drawn with same tag and global/not constructor.
2.) There's currently no way to change the global status of a manual drawn object thru script.
Be Safe in this Crazy World!
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
647 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
369 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
108 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
572 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
573 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment