Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

yPixelOffset

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    yPixelOffset

    Hi was the yPixelOffset changed in the last couple months? I updated to 8.0.18.1 two days ago and now my text labels drawn by my custom indicators no longer center on price. Comparing NT7 and NT8, equivalent "Draw.Text" statements in NT7 would center the text on price but NT8 required a yPixelOffset equal to about half the font height. Looks like something changed since I last updated NT a couple months ago because I now have to re-code the yPixelOffset. I could not find mention in the version update notes. Any clarificaiton would be appreciated. Thanks.

    #2
    Hello REI140205,

    Thanks for your post.

    I am not aware of any changes to the Draw.Text() method.

    You may want to check any variables that are feeding into Draw.Text() to see if anything has changed or is not as expected. It almost sounds like your "Text.Alignment" has changed?

    If your debugging effort does not yield an answer, please post some simplified code that demonstrates the issue you are experiencing.

    Comment


      #3
      Hi Paul, I have not touched code or settings and print my trading chart daily so have a record of the before/after. Immediately after my NT8 upgrade this occurred on 4 completely separate indicators on separate charts

      Here is a main line of code that draws a triangle marker text to indicate the opening price of a session:
      Draw.Text (this, "Open", false, "\u25c4 Open", rOffset1, rthOpen, yPO_4, colorOpen, font_arial8, saN,color0,color0,0);

      yPO_4 = the yPixelOffset using half the font height + 1. After NT8 upgrade, I have to set yPO_4 = 0 to get it to center.

      I think you mean "Text.Position" as it is a top-to-bottom not left-to-right issue, but I thought that was only a parameter to Draw.TextFixed. I don't know where to change that globally so that all Darw.Text commands in an indicator use textposition.center or textposition.bottom sort of idea.

      Comment


        #4
        Hello REI140205,

        Thanks for your reply.

        Yes, I was thinking horizontally not vertically, my mistake.

        What was the version you updated from?

        Comment


          #5
          Sorry, I don't know the previous version. I am on 17.0 on my other pc (used just to obfuscate) so likely similar and within last 3-4 months.

          Comment


            #6
            Hello REI140205,

            Thanks for your reply.

            In digging into this, in 8.0.15.1 we did have a situation where there was a shift in the yoffset when a default template for text was created and this was correct for 8.0.16.0 Can you verify that you do or do not have a template named "Default" in Documents>NinjaTrader8>templates>DrawingTool>Text> If you do have one, please remove it from the folder, restart and observe your text to see if it remains correct.

            Have you tested your scripts on another machine to see if they display correctly?

            Comment


              #7
              Yes, I confirm I had the template "Default" but after deleting and restarting my pc, the text remains centered-on-price. I contacted someone also using the indicators and they had identical issue using 8.0.18.0. Maybe at your end you could write a simple indicator that uses Draw.Text to see if text is drawn centered-on-price or otherwise.

              It is a minor inconvenience at my end because yPixelOffset was already coded into my UI's.

              Comment


                #8
                Hello REI140205,

                Thanks for your reply.

                I would be glad to test however I would need you to provide a test script that demonstrates the issue as otherwise, I would be guessing on parameters to use/set.

                Comment


                  #9
                  Ok, I will try to send you a link to a simple indicator that uses Draw.Text to draw the text "BEFGHPRS" on a chart. No parameters, no settings to guess at, just what any reasonable user would expect to see after reading the NT8 reference guide, and entering the bare minimum draw instruction. If NT8 by default draws text centered-on-price, then a manually drawn horizontal line will pass exactly through the middle of these letters.

                  Comment


                    #10
                    Hello REI140205,

                    Thanks for your reply.

                    I have not communicated correctly. I've already created a test script that shows me the text is centered vertically. I was hoping to see an example from you that demonstrates the issue you are reporting, IE: shift of offset.

                    Comment


                      #11
                      Yes, now text is centered vertically, we agree. My point is that prior to my recent NT8 upgrade it wasn't.

                      Originally I wrote:
                      "Comparing NT7 and NT8, equivalent "Draw.Text" statements in NT7 would center the text on price but NT8 required a yPixelOffset equal to about half the font height."

                      Comment


                        #12
                        Hello REI140205,

                        Thanks for your reply.

                        I've compared the current versions of NT7 to NT8 and text is centered on price. On NT8 I tested as far back as 8.0.15.0 (July 2018) and the text shows the same unless the default template is created which again was fixed starting with 8.0.16.0. When the default template was used in 8.0.15.0 then the text was shifted below the line.



                        Comment


                          #13
                          Thanks for your assistance Paul. This fully resolves my concern. It explains why I first noted the concern around that time, added a fix, and now can just undo it.

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                          0 responses
                          598 views
                          0 likes
                          Last Post Geovanny Suaza  
                          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                          0 responses
                          343 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by Mindset, 02-09-2026, 11:44 AM
                          0 responses
                          103 views
                          0 likes
                          Last Post Mindset
                          by Mindset
                           
                          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                          0 responses
                          557 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by RFrosty, 01-28-2026, 06:49 PM
                          0 responses
                          555 views
                          1 like
                          Last Post RFrosty
                          by RFrosty
                           
                          Working...
                          X