Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Text at top left of chart in strategy
Collapse
X
-
Text at top left of chart in strategy
I need to draw some text at the top left of my chart. How do I do that in a C# strategy in NT8? Do you have some sample code that does this?Tags: None
-
Ok thanks. Suppose I want to update that text at the close of each bar. Is there a way to delete/remove the text I draw on the previous bar and then call Draw.TextFixed for the new text? Or will Draw.TextFixed just overwrite whatever text i put there before?
Second question: suppose I want to draw multiple lines of text. Can I do that just by adding a "\n" character at the end of each line of text? Or is there another way I have to use?
Comment
-
Hello westofpluto,
To update it you just need to call the Draw. syntax again with the same tag name. All drawing objects work this way, if a unique tag is provided a new object is made otherwise the existing object will be updated when using the same tag.
You can use the newline character to add more lines. The alternative to that would be to use an indicator and OnRender, that would allow for using X/Y coordinates to draw text in more custom ways.
I look forward to being of further assistance.
Comment
-
Is OnRender only called for indicators and not strategies?You can use the newline character to add more lines. The alternative to that would be to use an indicator and OnRender, that would allow for using X/Y coordinates to draw text in more custom ways.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
116 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
61 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
40 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
43 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
82 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment