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

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,[FONT=Arial Black]0.4[/FONT],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

      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.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by algospoke, Yesterday, 06:40 PM
          2 responses
          19 views
          0 likes
          Last Post algospoke  
          Started by ghoul, Today, 06:02 PM
          3 responses
          14 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by jeronymite, 04-12-2024, 04:26 PM
          3 responses
          45 views
          0 likes
          Last Post jeronymite  
          Started by Barry Milan, Yesterday, 10:35 PM
          7 responses
          20 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by AttiM, 02-14-2024, 05:20 PM
          10 responses
          180 views
          0 likes
          Last Post jeronymite  
          Working...
          X