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 futtrader, 04-21-2024, 01:50 AM
          4 responses
          41 views
          0 likes
          Last Post futtrader  
          Started by Option Whisperer, Today, 09:55 AM
          1 response
          11 views
          0 likes
          Last Post bltdavid  
          Started by port119, Today, 02:43 PM
          0 responses
          8 views
          0 likes
          Last Post port119
          by port119
           
          Started by Philippe56140, Today, 02:35 PM
          0 responses
          7 views
          0 likes
          Last Post Philippe56140  
          Started by 00nevest, Today, 02:27 PM
          0 responses
          7 views
          0 likes
          Last Post 00nevest  
          Working...
          X