Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

DrawText Coding Error -- please help!

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

    DrawText Coding Error -- please help!

    Can anyone please tell me how to fix this code:

    Code:
    // draw retracement retracement text
    				DrawText(this._strWave2RetracementLinesTag + "RLBL" + index.ToString(), 
    					false, 
    					String.Format("{0:F2}", this._doubleRetracementLevels[index] * 100) + "%", 
    					intEndBarVL + 4, 
    					doubleY + this._doublePointOffset / 5, 
    					this._colorRetracementText[index], 
    					new Font(FontFamily.GenericSansSerif, this._intRetracementFontSize[index], this._fsRetracementText, GraphicsUnit.Pixel), 
    					StringAlignment.Center,
    					Color.Transparent,
    					Color.Transparent,
    					0);
    The error message says:

    No overload for method 'Draw Text' takes 11 arguments

    #2
    Hello lovemyipad,

    Thank you for your post.

    You are missing a overload for the DrawText() method which can be referenced from the link below -
    http://www.ninjatrader.com/support/h...l?drawtext.htm
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Cal View Post
      Hello lovemyipad,

      Thank you for your post.

      You are missing a overload for the DrawText() method which can be referenced from the link below -
      http://www.ninjatrader.com/support/h...l?drawtext.htm
      Hi, thanks so much, but I must confess you're giving me way too much credit! I have already read everything in the help manual, including the site you reference. I don't write code, so I don't know how to make/identify an overload, or where to put it. (I was so impressed with myself that I could even figure out how to find the problem in the code using F5!)

      This is an indicator that was written for an outdated version of Ninja Trader, and I would like to update it so it works with my version 7. But I know nothing about coding. I just push all the buttons until it works, or I break it.

      Is there any coder out there who can please, PLEASE help me???

      Comment


        #4
        lovemyipad,

        Can you possible share the indicator here so that I can review this on my end and get the correct format set for you?

        You can attach the indicator by clicking Reply -> Go Advanced -> Paperclip icon on the toolbar.

        The indicator will be located in (My) Documents -> NinjaTrader 7 -> bin -> Custom -> Indicator
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Cal, thanks so much for your reply -- especially for the detailed instructions on how to reply to your reply.
          Attached Files

          Comment


            #6
            Hello lovemyipad,

            Thank you for your response.

            The DrawText() was missing the y pixelOffset, please add the '0,' to the three DrawText methods as seen below:
            Code:
            			DrawText(wavehelper.******Tag, 
            				false, // autoscale
            				wavehelper.******Name, // text
            				this.CurrentBar - wavehelper.******Bar, // bars ago
            				(this.WaveType == ******Type.UpWave ? wavehelper.******Low - this._doublePointOffset : wavehelper.******High + this._doublePointOffset), 
            				[B]0,[/B]
            				this._colorWaveText[wavehelper.TDIndex], 
            				new Font(FontFamily.GenericSansSerif, this._intWaveTextFontSize[wavehelper.TDIndex], this._fsWaveText[wavehelper.TDIndex], GraphicsUnit.Pixel), 
            				StringAlignment.Center,
            				Color.Transparent,
            				Color.Transparent,
            				0);

            Comment


              #7
              Originally posted by NinjaTrader_PatrickH View Post
              Hello lovemyipad,

              Thank you for your response.

              The DrawText() was missing the y pixelOffset, please add the '0,' to the three DrawText methods as seen below:
              Patrick --

              It worked! It worked! It worked!

              Thank you! Thank you! Thank you!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by andrewtrades, Today, 04:57 PM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by chbruno, Today, 04:10 PM
              0 responses
              6 views
              0 likes
              Last Post chbruno
              by chbruno
               
              Started by josh18955, 03-25-2023, 11:16 AM
              6 responses
              436 views
              0 likes
              Last Post Delerium  
              Started by FAQtrader, Today, 03:35 PM
              0 responses
              7 views
              0 likes
              Last Post FAQtrader  
              Started by rocketman7, Today, 09:41 AM
              5 responses
              19 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Working...
              X