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 frankthearm, Today, 09:08 AM
        5 responses
        10 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        43 views
        0 likes
        Last Post jeronymite  
        Started by yertle, Today, 08:38 AM
        5 responses
        15 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by adeelshahzad, Today, 03:54 AM
        3 responses
        18 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by bill2023, Yesterday, 08:51 AM
        6 responses
        27 views
        0 likes
        Last Post NinjaTrader_Erick  
        Working...
        X