Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Multiple Draw Objects with same Tag name
Collapse
X
-
Multiple Draw Objects with same Tag name
If you run NinjaPriceAction on a chart and use your pointer to move a HH or LL label, you will see multiple labels overlapping each other, even though the code is making a Tag name for the object unique per bar number. There should only be 1 instance of an object per unique name, so why is this happening?Tags: None
-
The indicator can be found hereOriginally posted by NinjaTrader_Ben View PostHello,
What is NinjaPriceAction? If it is a custom program, this is beyond our level of support.
Even under it's default Calc on Bar Close = true, this occurs.
The code that draws the "HH", "LL" labels uses the standard convention of (Prefix)"HH"+CurrentBar to create a unique TagName for each label object per bar. However, multiple instances of the label appear on the same bar (move the topmost away with the pointer), apparently using the same "unique" TagName. Shouldn't there only be 1 object created using that name?
Comment
-
Originally posted by NinjaTrader_Bertrand View Postmarketmasher, correct it uses unique tags to show the history of drawn objects - as for the overlap, you would either need to debug this code or ask the original author via PM directly if he has an input.
Thanks for the reply. However, there is not really anything to debug, because the naming convention is standard in NT to ascribe a drawing object a unique name. It can't be made simpler, so there is nothing to change.
My suspicion is that using the current bar to name an object positioned on a previous bar in history is not sitting right with NT's internal tagname tracking, but that's only a guess at this point.
BTW - the reason I noticed this was because the indicator seemed to take an unusually long time to load, and after inspection, it must be all the superfluous labels it is drawing.Last edited by marketmasher; 08-24-2009, 06:47 AM.
Comment
-
Ok - thx. "Debug" is a word I usually associate with a coding error. "Work-around" is more like doing something to get around a glitch.Originally posted by NinjaTrader_Bertrand View PostI meant debug in a sense to optimize for what you're looking for, correct long loading time can be attributed to many drawing objects being placed historically, you can add a block to do this only for the current trading day to achieve better performance.
I will look at limiting the execution period to limit the problem.
Comment
-
FYI to anyone interested, there is a fix. I was correct - NT is not tracking the object tagname of a label drawn on a historical bar correctly if using CurrentBar (for whatever reason). The solution is to replace the code DrawText("HH"+CurrentBar,"HH",...etc with DrawText("HH"+(CurrentBar-barsback),"HH",....etc so that the label is associated with the bar it is actually sitting on. Don't know why this is the case, as an identifying number is an identifying number (or so one would think), but it removes all the superfluous label drawing and resource consumption.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
648 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
369 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
108 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
572 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
574 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment