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 DannyP96, 05-18-2026, 02:38 PM
            1 response
            29 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 05-11-2026, 05:56 AM
            0 responses
            117 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 05-10-2026, 08:12 PM
            0 responses
            69 views
            0 likes
            Last Post CarlTrading  
            Started by Hwop38, 05-04-2026, 07:02 PM
            0 responses
            227 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Started by Mindset, 04-21-2026, 06:46 AM
            0 responses
            309 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X