Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawTextFixed - longer syntax

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

    DrawTextFixed - longer syntax

    HI everyone

    I want to make some text in DrawTextFixed a bit more readable.

    So, from Help, I'll need the following syntax:

    DrawTextFixed(string tag, string text, TextPosition textPosition, Color textColor, Font font, Color outlineColor, Color areaColor, int areaOpacity)

    I haven't managed to implement this without getting error messages.

    I'd really appreciate any example of this longer syntax so I can work from it.

    Many thanks in advance.

    #2
    Hello,

    Thank you for the question.

    This is a common item related to the font generally.

    You would need to create a new font to be used with this, the Font name is just a string which you can see in any text editor like Microsoft word.

    Here is the complete syntax:

    Code:
    DrawTextFixed("TextTag", "Some Text", TextPosition.BottomRight, Color.Red, new Font("Arial", 14), Color.Gray, Color.Gray, 10);
    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks as always, Jesse. That's exactly what I needed.

      Can I make the suggestion that this type of example would be very useful if it appeared in Help, which lacks examples, such as this, in many areas.

      Maybe in a future version of NT, more examples could be included?

      Thanks for considering this.

      Comment


        #4
        Hello,

        Thank you for the suggestion.

        This has been noted for future versions of the platform so hopefully we can include this among other new examples for the existing methods that may be lacking now.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Thanks, Jesse.

          Just a supplementary question: would DrawTextFixed be counted as a method that affects performance in terms of CPU usage? Or would it be fairly trivial?

          Thanks for letting me know.

          Comment


            #6
            Hello,

            This item would be fairly trivial because its intended purpose is for drawing a single tagged string in one of 5 positions.
            At max you could use 5 of these calls and still be able to read them, you could certainly use them more to cause more use of the CPU but that would be fairly useless because they would be on top of each other.

            DrawText on the other hand can eat a lot of CPU if you are doing something like drawing text on every bar for 40,000 bars as an example, DrawTextFixed over 40,000 bars is still just 1 object because of the Tag.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Barry Milan, Today, 10:35 PM
            1 response
            8 views
            0 likes
            Last Post Barry Milan  
            Started by WeyldFalcon, 12-10-2020, 06:48 PM
            14 responses
            1,428 views
            0 likes
            Last Post Handclap0241  
            Started by DJ888, Yesterday, 06:09 PM
            2 responses
            9 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by jeronymite, 04-12-2024, 04:26 PM
            3 responses
            40 views
            0 likes
            Last Post jeronymite  
            Started by bill2023, Today, 08:51 AM
            2 responses
            16 views
            0 likes
            Last Post bill2023  
            Working...
            X