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 Rapine Heihei, Today, 08:19 PM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by Rapine Heihei, Today, 08:25 PM
          0 responses
          6 views
          0 likes
          Last Post Rapine Heihei  
          Started by f.saeidi, Today, 08:01 PM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by Rapine Heihei, Today, 07:51 PM
          0 responses
          8 views
          0 likes
          Last Post Rapine Heihei  
          Started by frslvr, 04-11-2024, 07:26 AM
          5 responses
          98 views
          1 like
          Last Post caryc123  
          Working...
          X