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 and DrawTextFixed

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

    DrawText and DrawTextFixed

    The links for the "The type of Font used (reference)" are broken for both DrawText and DrawTextFixed. So I went searching for some examples on the MSDN site and came up empty (my lack of knowledge).

    What is the correct syntax for the Font Parameters in

    DrawText(.............., Color textColor, Font font, StringAlignment .....);

    Thanks.

    #2
    Something like this
    private Font textFont = new Font("Arial", 12);
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      how to use the new font variable?

      if i try print something with this new Font variable i get an invalid expression term, can you complete the code segment for me:

      DrawText("My text" + CurrentBar, "Hello World", 0, Low[0] -20 * TickSize, Color.Red, Font textFont);

      Originally posted by Josh View Post
      Something like this
      private Font textFont = new Font("Arial", 12);

      Comment


        #4
        try something like
        ... , textFont);

        Comment


          #5
          DrawText and DrawTextFixed Errors with Color, Font, etc.

          Hello:

          I have tried the suggestions in this Thread to get Color, Font, etc. to compile. However, I continually get the dreaded: "No overload for method 'DrawTextFixed' takes '4', '5', etc. arguments.

          Should the line "Private Font textFont..." be in just the Variable section, or also Initialize, etc. Please advise.

          Thanks. Tony.

          Comment


            #6
            tonyh,

            Please post up everything you have. We have no idea what you have typed out right now. Thanks.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              DrawText and DrawTextFixed

              Hello Josh:

              After experimenting, I found out that all options in DrawTextFixed must be included. I was leaving out things such as opacity in the statement. I had assumed one could just include the options that were desired. Thanks.
              Tony.

              Comment


                #8
                DrawText () help

                I am trying to get the following example to work on my chart.

                I get an error message that 10 is out of range, so I change to 0, and nothing happens.

                DrawText("tag1", "Text to draw", 10, 1000, Color.Black);

                Could someone please explain exactly what 10 is? and how is the Y coordinate defined? I mean is it a pixel location on the chart, or or based on price? Sorry, I just confused.

                Thanks

                Comment


                  #9
                  10 is on which bar back you want to draw on. Y-coordinate is based on price.


                  If you call 10 bars back you need to ensure you have 10 bars on your chart first. Please see this tip: http://www.ninjatrader-support2.com/...ead.php?t=3170
                  Josh P.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by FrazMann, Today, 11:21 AM
                  1 response
                  6 views
                  0 likes
                  Last Post FrazMann  
                  Started by lorem, Yesterday, 09:18 AM
                  5 responses
                  18 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by Spiderbird, Today, 12:15 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post Spiderbird  
                  Started by cmtjoancolmenero, Yesterday, 03:58 PM
                  12 responses
                  42 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by geddyisodin, Yesterday, 05:20 AM
                  8 responses
                  52 views
                  0 likes
                  Last Post NinjaTrader_Gaby  
                  Working...
                  X