Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Clear Drawing objects

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

    Clear Drawing objects

    I have a drawing object in my strategy but what is the code to clear it when it is no longer wanted?

    DrawRectangle("ema1060", 20, EMA(BarsArray[2],10)[0], 0, EMA(BarsArray[2],10)[0] + 0.0010, Color.Transparent, Color.Blue, 2);

    If the price is going up then I want to clear this rectangle but it stays there at the level it was set at when I activate it when the price is heading down?

    Thanks

    #2
    nigeleyre, please check into these two methods for this -



    Comment


      #3
      Many thanks, perfect.

      Next question, I have my right side margin set up on my charts at 100, is there any way of getting the text to write in this margin instead of over the chart?

      And second, is there any way of setting larger top and bottom margins?

      Thank you,

      Nigel.

      Comment


        #4
        Only way to write into the margin is to use DrawTextFixed(). There is no way to change the top/down margin.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          As far as I understand it with DrawTextFixed() you can only print the text either top, bottom or centre - is there any way to give it a Y co-ordinate where you want it printed?

          I want on a 15 minute chart to print where the hourly EMA(100) is but do not want the text to be merged over the price data, hence I want to draw in the free area to the right of the price action.

          Comment


            #6
            Unfortunately there's no such input in DrawTextFixed(), it plots to 5 predetermined locations.

            Comment


              #7
              Pity!.............

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by charlesugo_1, 05-26-2026, 05:03 PM
              0 responses
              65 views
              0 likes
              Last Post charlesugo_1  
              Started by DannyP96, 05-18-2026, 02:38 PM
              1 response
              149 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by CarlTrading, 05-11-2026, 05:56 AM
              0 responses
              162 views
              0 likes
              Last Post CarlTrading  
              Started by CarlTrading, 05-10-2026, 08:12 PM
              0 responses
              99 views
              0 likes
              Last Post CarlTrading  
              Started by Hwop38, 05-04-2026, 07:02 PM
              0 responses
              286 views
              0 likes
              Last Post Hwop38
              by Hwop38
               
              Working...
              X