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
    Paul H.NinjaTrader Customer Service

    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.
        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by r68cervera, Today, 05:29 AM
        0 responses
        1 view
        0 likes
        Last Post r68cervera  
        Started by geddyisodin, Today, 05:20 AM
        0 responses
        3 views
        0 likes
        Last Post geddyisodin  
        Started by JonesJoker, 04-22-2024, 12:23 PM
        6 responses
        33 views
        0 likes
        Last Post JonesJoker  
        Started by GussJ, 03-04-2020, 03:11 PM
        12 responses
        3,239 views
        0 likes
        Last Post Leafcutter  
        Started by AveryFlynn, Today, 04:57 AM
        0 responses
        6 views
        0 likes
        Last Post AveryFlynn  
        Working...
        X