Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

drawtext orientation change

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

    drawtext orientation change

    1. drawtext seems to print only left to right. i find a realestate issue especially when its overlapping the bars. is there a way, i can change orientation so that it writes vertically. this way, i can ensure that it does not overlap with other drawings.
    2. i draw a diamond indicating that the ema9>ema22. the chart looks crowded now. how can i plot the diamond so its equidistant from the bottom just below the lowest bar on the screen.
    my code is as follows
    Code:
     if(EMA(9)[0]<EMA(22)[0])
    		  {
    			  Draw.Diamond(this, "short_" + CurrentBar, true, 0, High[1] + 5*TickSize, Brushes.DarkGreen);
    		  }
    Last edited by junkone; 01-14-2016, 10:12 PM.

    #2
    Hello junkone,

    Thanks for your post.

    Regrettable the DrawText() method only prints horizontally. You might consider adding an offset to place the text well above the High[0] of the bar.

    There would be no easy way to draw the diamonds "equidistant from the bottom just below the lowest bar on the screen." As the indicator loads each bar it does not know what the lowest bar on the screen is.

    Alternatively you might consider indicating the conditions of ema9>ema22 and ema9<ema22 by other means such as:
    1) Color the EMA(9) itself when ema9>ema22 or ema9<ema22
    2) Painting the bars
    3) Coloring the background

    1) http://ninjatrader.com/support/helpG...plotcolors.htm
    2) http://ninjatrader.com/support/helpG...?backcolor.htm
    3) http://ninjatrader.com/support/helpG.../?barcolor.htm

    Comment


      #3
      I find a function chartScale.MinValue that gives the minimum value on the screen. how can i access it from the indicator methods?

      Comment


        #4
        Hello junkone,

        Thanks for your reply.

        This would require custom drawing through the OnRender() method. Please see: http://ninjatrader.com/support/helpG...?rendering.htm

        You can examine the indicator SampleCustomPlot.cs in your NinjaTrader 8 for an example of use.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        669 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        378 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        111 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        575 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        580 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X