Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to draw a rectangle on panels other than the price panel
Collapse
X
-
Hello goWms,
Thank you for your post.
You can use the overload that lets you set DrawOnPricePanel to false. This will draw the rectangle on the indicator panel itself.
Note that draw objects can only be drawn on the price panel, or the indicator panel.
Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.
Draw.Rectangle(NinjaScriptBase owner, string tag, bool isAutoScale, int startBarsAgo, double startY, int endBarsAgo, double endY, Brush brush, Brush areaBrush, int areaOpacity, bool drawOnPricePanel)
Draw.Rectangle(NinjaScriptBase owner, string tag, bool isAutoScale, DateTime startTime, double startY, DateTime endTime, double endY, Brush brush, Brush areaBrush, int areaOpacity, bool drawOnPricePanel)
-
I must be doing something wrong. I cannot even get a rectangle to draw on the price panel. The code I am using in OnBarUpdate() is below:
// Draw.Rectangle(NinjaScriptBase owner, string tag, bool isAutoScale, int startBarsAgo, double startY, int endBarsAgo, double endY, Brush brush, Brush areaBrush, int areaOpacity, bool drawOnPricePanel)
Draw.Rectangle(this, "tag", true, 10, High[10], 0, Low[0], Brushes.CornflowerBlue, Brushes.CornflowerBlue, 50, true);
Perhaps you could send working code that I can look at and see my mistakes.
Please advise.
Thanks, Gordon
Comment
-
Hello,
Thank you for your post.
Are you seeing any errors in the Log tab of the Control Center?
Below is a simple sample script which draws on the indicator panel using this overload:
Draw.Rectangle(NinjaScriptBase owner, string tag, bool isAutoScale, int startBarsAgo, double startY, int endBarsAgo, double endY, Brush brush, Brush areaBrush, int areaOpacity, bool drawOnPricePanel)
Attached Files
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
556 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
324 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 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
545 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
547 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment