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 cmoran13, 04-16-2026, 01:02 PM
                0 responses
                43 views
                0 likes
                Last Post cmoran13  
                Started by PaulMohn, 04-10-2026, 11:11 AM
                0 responses
                25 views
                0 likes
                Last Post PaulMohn  
                Started by CarlTrading, 03-31-2026, 09:41 PM
                1 response
                162 views
                1 like
                Last Post NinjaTrader_ChelseaB  
                Started by CarlTrading, 04-01-2026, 02:41 AM
                0 responses
                98 views
                1 like
                Last Post CarlTrading  
                Started by CaptainJack, 03-31-2026, 11:44 PM
                0 responses
                157 views
                2 likes
                Last Post CaptainJack  
                Working...
                X