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 Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              648 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              369 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              108 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              572 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              573 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X