Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
IText.BarsAgo
Collapse
X
-
IText.BarsAgo
In NT7 IText had a property BarsAgo. Is there a replacement for it with the new Text class?Tags: None
-
All draw objects will have some sort of "ChartAnchor" field which exposes this information, rather than a field directly on the interface/object itself.
e.g.,
Code:Text myText = Draw.Text(this, "tag", "test", 0, High[0]); Print(myText.Anchor.BarsAgo); // the barsAgo value passed to the method Print(myText.Anchor.DrawnOnBar); // the actual current bar
MatthewNinjaTrader Product Management
-
Hi Matthew,
I use to be able to just set the BarsAgo property (say to -1) on a Text object to get it to move to the end of the chart on the x-axis after every new bar. I assumed this was more efficient than deleting the old one and creating a new one. How would I do that with the new drawing objects?
Comment
-
Originally posted by GrumpyTrader View PostHi Matthew,
I use to be able to just set the BarsAgo property (say to -1) on a Text object to get it to move to the end of the chart on the x-axis after every new bar. I assumed this was more efficient than deleting the old one and creating a new one. How would I do that with the new drawing objects?
Draw.Dot(this, "tag", false, -1, High[0], Brushes.Blue);
What chart setup, method, indicator settings, etc are you using?
What is it currently doing instead of moving to the next bar?MatthewNinjaTrader Product Management
Comment
-
If you meant on the IDrawingTool object, you can use the Time[0] property
Code:protected override void OnBarUpdate() { if(State.Historical == State) myText = Draw.Text(this, "tag", "Test", 5, High[0], Brushes.Blue); else if(myText != null) myText.Anchor.Time = Time[0]; }
MatthewNinjaTrader Product Management
Comment
-
Thanks, setting the time works perfectly. Lastly, I'm not sure if it is a bug, but for some reason when using the Ray object the intellisense doesn't show you the Tag property even though it is there.
Comment
-
Hi GrumpyTrader,
I was able to confirm that Tag is not in the intellisense list for IDrawingTools.
You can use this, and it will compile if you do, but its not in the list.
I appreciate you reporting this issue.
I have submitted a bug report about this to development. Please let me know if you find any other issues in NT8 you would like to report.Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by pvincent, 06-23-2022, 12:53 PM
|
14 responses
238 views
0 likes
|
Last Post
by Nyman
Today, 12:47 AM
|
||
Started by TraderG23, 12-08-2023, 07:56 AM
|
9 responses
383 views
1 like
|
Last Post
by Gavini
Today, 12:29 AM
|
||
Started by oviejo, Today, 12:28 AM
|
0 responses
1 view
0 likes
|
Last Post
by oviejo
Today, 12:28 AM
|
||
Started by pechtri, 06-22-2023, 02:31 AM
|
10 responses
125 views
0 likes
|
Last Post Today, 12:03 AM | ||
Started by judysamnt7, 03-13-2023, 09:11 AM
|
4 responses
59 views
0 likes
|
Last Post
by DynamicTest
Yesterday, 08:25 PM
|
Comment