Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Keeping Old Drawing Objects

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

    Keeping Old Drawing Objects

    Hello All-

    I created a script that uses the Draw.Rectangle code to highlight an area when a custom three candlestick pattern occurs. It works as it should but when that 3 candlestick pattern occurs again the previous rectangle disappears when the new one is drawn on the chart.

    How do I keep the old rectangle objects on the chart even when a new one is drawn?

    Thank you,

    Nick

    #2
    Hello njmeyer713,

    Thanks for your post.

    You must assign a unique Tag name to the Draw method to have the previous drawings remain on the chart when the condition to draw a new object becomes true.

    From the Draw.Rectangle() help guide page linked below: "..if you pass in a value of "myTag", each time this tag is used, the same draw object is modified. If unique tags are used each time, a new draw object will be created each time."

    The code might look something like this: Draw.Rectangle(this, "tag1" + CurrentBar, 10, Low[10] - TickSize, 5, High[5] + TickSize, Brushes.Blue);

    Draw.Rectangle(): https://ninjatrader.com/support/help..._rectangle.htm

    Let me know if I may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Brandon-

      Quick and easy response that works. Thank you for that, I appreciate it.

      Comment


        #4
        there should be pop up tool tips that let you know of this.
        good info!

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        52 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        130 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        70 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        44 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        49 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X