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 StockTrader88, 03-06-2021, 08:58 AM
          45 responses
          3,992 views
          3 likes
          Last Post johntraderuser2  
          Started by TAJTrades, Today, 09:46 AM
          0 responses
          7 views
          0 likes
          Last Post TAJTrades  
          Started by rhyminkevin, Yesterday, 04:58 PM
          5 responses
          62 views
          0 likes
          Last Post dp8282
          by dp8282
           
          Started by realblubb, Today, 09:28 AM
          0 responses
          8 views
          0 likes
          Last Post realblubb  
          Started by AaronKoRn, Yesterday, 09:49 PM
          1 response
          19 views
          0 likes
          Last Post Rikazkhan007  
          Working...
          X