Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ypixeloffset in DrawText

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

    ypixeloffset in DrawText

    Hi all,

    I am trying to drawtext() on chart.
    I set ypixeloffset to be 0, the file compiled successfully but there is nothing displayed in the panel.
    Is there anybody can help me?

    Thanks

    -Q

    #2
    Hello,

    Please post some of your code here, as likely we will need to see it to find out what's going on.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by qzhang119 View Post
      Hi all,

      I am trying to drawtext() on chart.
      I set ypixeloffset to be 0, the file compiled successfully but there is nothing displayed in the panel.
      Is there anybody can help me?

      Thanks

      -Q
      What is the error, if any, in your log?

      Comment


        #4
        Hi Adam,

        The code is here:

        // draw the starting point # on price chart
        DrawText(string.Format("divPr{0}",Time[loPeaks[0].BarsBack].TimeOfDay),true,"1",loPeaks[0].BarsBack, loPeaks[0].Close, 100, Color.White, myFont,StringAlignment.Center,Color.Black,Color.Bl ack,60);
        After Compile, the log shows:

        9/22/2012 5:57:08 PM Default Failed to call method 'Initialize' for indicator 'GbDivergence2': 'BarsInProgress' property can't be accessed from within 'Initialize' method
        Is that means, I have errors in 'Initialize' and 'BarsInProgress'?

        Thanks,

        -Q

        Comment


          #5
          Hi koganam,

          The code is here:
          // draw the starting point # on price chart
          DrawText(string.Format("divPr{0}",Time[loPeaks[0].BarsBack].TimeOfDay),true,"1",loPeaks[0].BarsBack, loPeaks[0].Close, 100, Color.White, myFont,StringAlignment.Center,Color.Black,Color.Bl ack,60);
          After Compile, the log shows:
          9/22/2012 5:57:08 PM Default Failed to call method 'Initialize' for indicator 'GbDivergence2': 'BarsInProgress' property can't be accessed from within 'Initialize' method
          Is that means, I have errors in 'Initialize' and 'BarsInProgress'?

          Thanks,

          -Q

          Comment


            #6
            Originally posted by qzhang119 View Post
            Hi koganam,

            The code is here:


            Is that means, I have errors in 'Initialize' and 'BarsInProgress'?

            Thanks,

            -Q
            It means that you are trying to access a bar series in the Initialize() method. The bar series do not yet exist when that method is called. Move the statement to some place where a bar series exists.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            110 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            59 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            37 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            41 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            78 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X