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

Stop DrawTextFixed from overlapping

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

    Stop DrawTextFixed from overlapping

    Hi,
    I'm using DrawTextFixed but am having trouble stopping it from overlapping previously added text. The code below draws GBP over the USD text...I'd like to set an x offset to draw the GBP text to the left of the USD text.
    How do I do this?

    Code:
    DrawTextFixed("USD", "USD", TextPosition.BottomRight,Color.Red, new Font("Arial", 10),Color.Aquamarine, Color.LightGray, 5);
    DrawTextFixed("GBP", "GBP", TextPosition.BottomRight,Color.Blue, new Font("Arial", 10),Color.Aquamarine, Color.LightGray, 5);

    #2
    Hello,
    Thank you for your post.
    Aside from changing the message to "GBPUSD" I am unaware of any supported method to accomplish this. I am currently looking into other ways to achieve this. I will keep this thread open so that other members of the forum can suggest alternatives as well.
    Cody B.NinjaTrader Customer Service

    Comment


      #3
      Hmm DrawText() might be able to do it, but the method description really doesn't help me in deciphering the various parameters...

      Comment


        #4
        Originally posted by itsnotme View Post
        Hmm DrawText() might be able to do it, but the method description really doesn't help me in deciphering the various parameters...

        https://ninjatrader.com/support/help.../?drawtext.htm
        I think you will need to use DrawString(string StringToShow, Font myFont,Brush myBrush,int x,int y);
        and put it in public override void Plot(Graphics graphics, Rectangle bounds, double min, double max).
        Like that you can control the exact position of the text. Hope this help.

        Comment


          #5
          Originally posted by itsnotme View Post
          Hmm DrawText() might be able to do it, but the method description really doesn't help me in deciphering the various parameters...

          https://ninjatrader.com/support/help.../?drawtext.htm
          For what you are describing, you will need to use a custom Plot().

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Touch-Ups, Today, 10:36 AM
          0 responses
          5 views
          0 likes
          Last Post Touch-Ups  
          Started by geddyisodin, 04-25-2024, 05:20 AM
          8 responses
          61 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by jxs_xrj, 01-12-2020, 09:49 AM
          4 responses
          3,289 views
          1 like
          Last Post jgualdronc  
          Started by Option Whisperer, Today, 09:55 AM
          0 responses
          5 views
          0 likes
          Last Post Option Whisperer  
          Started by halgo_boulder, 04-20-2024, 08:44 AM
          2 responses
          24 views
          0 likes
          Last Post halgo_boulder  
          Working...
          X