Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trying to convert a study from nt6.5 to nt7

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

    Trying to convert a study from nt6.5 to nt7

    I have made and been using this indicator in nt6.5 for sometime. Today I tried to convert it to nt7. I got the following error when I try to compile the indicator: No overload for method 'DrawText' takes '11' arguments

    So I think the drawtext code has been changed in nt7.

    The code is the following:
    DrawText("p" + CurrentBar, false, k1, 0, (p-0.000025), color1, tf, StringAlignment.Center, Color.Transparent, Color.Transparent, 0);

    How do I change this code in order to make it work in nt7?

    Thank you.

    #2
    This is from the NT6.5 Help:

    DrawText(string tag, bool autoScale, string text, int barsAgo, double y, int yPixelOffset, Color textColor, Font font, StringAlignment alignment, Color outlineColor, Color backColor, int opacity)

    This works in NT7 also. It looks like you need to change your DrawText() statement for both NT6.5 and NT7.
    eDanny
    NinjaTrader Ecosystem Vendor - Integrity Traders

    Comment


      #3
      Thanks for replying.

      I just compiled the same code under nt6.5 and run the study on some charts, it works fine there.

      Comment


        #4
        You MUST specify the "yPixelOffset" parameter. It is no longer optional.

        Comment


          #5
          Originally posted by koganam View Post
          You MUST specify the "yPixelOffset" parameter. It is no longer optional.
          Thank you. After adding ypixeloffset, I got it compiled successfully, but I can't get it display on the chart. What's ypixeloffset? What does it do? I have tried, 0, 1, 100 and 1000, but it still doesn't work.

          Comment


            #6


            It would just define an offset from your Y axis price value...

            Comment


              #7
              Originally posted by NinjaTrader_Bertrand View Post
              http://www.ninjatrader.com/support/h...7/drawtext.htm

              It would just define an offset from your Y axis price value...
              Does it mean it's the distance between the drawn object and the last price value?

              I already have the "double y" to tell where the object should be drawn. So what value should I give to the yPixelOffset.

              Let say for Eur, the price increment is 0.0001, what should the ypixel be?
              And Ym, it's 1, what should the ypixel be?

              Please give me a few examples.

              Thank you.

              Btw, I have other questions. Does nt7.0 use more resource than nt6.5? Will nt6.5 cease to work one day? If so, when?

              Comment


                #8
                The pixel offset is just a fine tune for your Y position. If you need to lines things up better the pixel offset will adjust in screen pixels. If there is no need for fine adjustment, use 0 (zero).
                eDanny
                NinjaTrader Ecosystem Vendor - Integrity Traders

                Comment


                  #9
                  Many thanks for all you guys' help.

                  I reset it back to 0 and recompiled it. Although the compilation is successful, I still couldn't get the study to displayed.

                  I think I will stick with nt6.5 for now, hopefully it will continue to work.

                  Many thanks once again.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  596 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
                  556 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  554 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X