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 GussJ, 03-04-2020, 03:11 PM
                  16 responses
                  3,281 views
                  0 likes
                  Last Post Leafcutter  
                  Started by WHICKED, Today, 12:45 PM
                  2 responses
                  19 views
                  0 likes
                  Last Post WHICKED
                  by WHICKED
                   
                  Started by Tim-c, Today, 02:10 PM
                  1 response
                  9 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by Taddypole, Today, 02:47 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post Taddypole  
                  Started by chbruno, 04-24-2024, 04:10 PM
                  4 responses
                  53 views
                  0 likes
                  Last Post chbruno
                  by chbruno
                   
                  Working...
                  X