Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawTextFixed

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

    DrawTextFixed

    NinjaTrader,
    I have been trying to use the DrawTextFixed in an indicator. When I use

    DrawTextFixed("Cycle","Cycle Period = "+Period,TextPosition.BottomLeft);

    It works fine, but when I add a color option, or opacity it won't compile.

    DrawTextFixed("Cycle","Cycle Period = "+Period,TextPosition.BottomLeft, Color.Red);

    Compiler gives the error, No Overload for method DrawTextFixed takes '4' arguments.

    According to the help files the Method allows for properties to be used with this command.

    What am I missing?

    #2
    Hello BigMike,

    Thank you for your post.

    You can use a color in your DrawTextFixed() but you have to place values for all arguments expected.

    DrawTextFixed(string tag, string text, TextPosition textPosition, Color textColor, Font font, Color outlineColor, Color backColor, int opacity)

    An example is below:


    Code:
     
     
    DrawTextFixed("Cycle","Cycle Period = " + Period, TextPosition.BottomLeft,Color.Black, new Font("Arial", 12), Color.Black, Color.White, 100);
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Good Example

      RyanM,
      Thanks, the examples in the Help Files are not as thorough as this one.
      This should do it.

      Comment


        #4
        I feel the examples are good enough but what is lacking is help from intellisense for the long version while actually typing the code. This is something that really should be addressed with all statements that have more than one syntax.
        eDanny
        NinjaTrader Ecosystem Vendor - Integrity Traders

        Comment


          #5
          eDanny, you could switch available overloads with the up / dn arrows and then Intellisense should assist you also with using the longer, more exotic ones.

          Comment


            #6
            Thanks Bertrand, I'll try that. There is still a problem if I didn't know about a feature like that. Maybe a better user manual for your editor? Dan

            I just tried it and I like it!
            eDanny
            NinjaTrader Ecosystem Vendor - Integrity Traders

            Comment


              #7
              You're welcome, this is documented here under the NinjaScript section entry - http://www.ninjatrader-support.com/H...ellisense.html

              Comment


                #8
                I see that Bertrand and I checked that before making my previous post. I missed it then and I guess I have missed it before because I must have just skimmed over it.
                eDanny
                NinjaTrader Ecosystem Vendor - Integrity Traders

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                578 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                334 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                101 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                554 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                551 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X