I'm well aware that the answer may be "Don't do that". I'm just hoping there is a better answer than to use OnRender() and draw my own custom arrows.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to position a text box near an arrow?
Collapse
X
-
How to position a text box near an arrow?
I am using Draw.ArrowUp() and Draw.ArrowDown() in OnBarUpdate(). I would like to position a text box slightly below an up arrow and slightly above a down arrow. How do I find the correct y-value to pass to Draw.Text()? I need an answer that will produce the right effect even when the user scrolls the chart.
I'm well aware that the answer may be "Don't do that". I'm just hoping there is a better answer than to use OnRender() and draw my own custom arrows.Tags: None
-
-
Problem solved. Sample found by Visual Studio searching the solution. It takes a lot more code in OnRender() but the result works very well. I'm still curious whether there is a good solution using OnBarUpdate() but I doubt that there is.
Comment
-
Hello ETFVoyageur,
With Draw.Text() the y coordinate is actually a price value and not the actual x,y of the render area.
The text will be drawn just below the price supplied as the y.
This will be the same with the Draw.ArrowUp().
The size of the arrow will not scale as the chart scales. So the distance from the bottom of an arrow would not be consistent and will change.
You could choose to get the price of the arrow chart anchor, and then subtract or 2 ticks from this and use this as the price of the text. But it's not going to be exact since the chart scaling will change over time.
Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
581 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
338 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 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
554 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
552 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment