• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Text left side of indicator panel

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

    Text left side of indicator panel

    Hi there,

    I' ve been browsing the forum for over an hour now and not finding what I need.

    I'm trying to add text to an indicator panel (in NT7). The text should be plotted on the left side of the panel and should stay there, regardless of scrolling.

    I looked here: http://www.ninjatrader-support.com/H...TextFixed.html , but that page does not load

    I have this code now:
    Code:
    DrawText("test","EMA 60",TextPosition.Center);
    , but that obviously just plots in the center of the panel

    As a bonus, i would like to decide the y-level of where the text should be printed. Tried doing that like this:
    Code:
    DrawText("test2",false,"EMA 60 bis",10,0.4,0,Color.Black,Arial,StringAlignment.Far,Color.Black,Color.Transparent,5);
    , but no succes (error too many arguements)


    Please help

    #2
    You can overwrite the plot method:

    public override void Plot(Graphics graphics, Rectangle bounds, double min, double max)
    {

    graphics.DrawString("My String", textFont, textBrush, x, y, stringFormat);

    }

    Comment


      #3
      Hello Spinn,

      Thank you for your post.

      Tom299 provides one possible solution, although a bit more complicated. You can just use the DrawTextFixed() method: http://ninjatrader.com/support/helpG...wtextfixed.htm
      Patrick H.NinjaTrader Customer Service

      Comment


        #4
        I did try that DrawTextFixed- solution before, but it does not allow for text to be set at a specific y-value, does it ?

        I mean: I don't want the text to be in a TopLeft or Bottom Left corner, but nicely in front of my row of dots/diamonds (and they are at 0.2, 0.4 and 0.6 in the indicator panel respectively)


        Thanks Tom299, I have been fiddling with your solution as well, but cannot seem to figure out WHERE I would need to add these lines Can you assist me on this ?

        Thanks to both of you !

        Comment


          #5
          Hello Spinn,

          There is actually an example using the Plot override under Tools > Edit NinjaScript > Indicator > CustomPlotSample.
          Patrick H.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Johnny Santiago, Today, 12:20 PM
          0 responses
          2 views
          0 likes
          Last Post Johnny Santiago  
          Started by NinjaTrader_Brandon, Today, 10:24 AM
          0 responses
          24 views
          0 likes
          Last Post NinjaTrader_Brandon  
          Started by ptertich, Today, 07:56 AM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_ChrisL  
          Started by aslane, Today, 08:24 AM
          1 response
          14 views
          0 likes
          Last Post NinjaTrader_ChrisL  
          Started by Capablanca, Yesterday, 05:51 PM
          1 response
          13 views
          0 likes
          Last Post NinjaTrader_PaulH  
          Working...
          X