Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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
-
Originally 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
-
I 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.BertrandNinjaTrader Customer Service
Comment
-
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 elirion, Today, 01:36 AM
|
0 responses
3 views
0 likes
|
Last Post
by elirion
Today, 01:36 AM
|
||
Is it possible to have a drawing, such as a line, cycle through different colors?
by gentlebenthebear
Started by gentlebenthebear, Today, 01:30 AM
|
0 responses
4 views
0 likes
|
Last Post Today, 01:30 AM | ||
Started by samish18, Yesterday, 08:31 AM
|
2 responses
9 views
0 likes
|
Last Post
by elirion
Today, 01:28 AM
|
||
Started by Mestor, 03-10-2023, 01:50 AM
|
16 responses
391 views
0 likes
|
Last Post
by z.franck
Today, 01:04 AM
|
||
Started by rtwave, 04-12-2024, 09:30 AM
|
4 responses
34 views
0 likes
|
Last Post
by rtwave
Today, 12:50 AM
|
Comment