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 CarlTrading, 03-31-2026, 09:41 PM
            1 response
            68 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            38 views
            0 likes
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            62 views
            1 like
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            62 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            53 views
            0 likes
            Last Post CarlTrading  
            Working...
            X