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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
127 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
73 views
1 like
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
115 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
109 views
1 like
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
88 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment