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 techgetgame, Today, 11:42 PM
            0 responses
            7 views
            0 likes
            Last Post techgetgame  
            Started by sephichapdson, Today, 11:36 PM
            0 responses
            1 view
            0 likes
            Last Post sephichapdson  
            Started by bortz, 11-06-2023, 08:04 AM
            47 responses
            1,612 views
            0 likes
            Last Post aligator  
            Started by jaybedreamin, Today, 05:56 PM
            0 responses
            9 views
            0 likes
            Last Post jaybedreamin  
            Started by DJ888, 04-16-2024, 06:09 PM
            6 responses
            19 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Working...
            X