Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

can`t detect manually brushed rectangle

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

    #16
    With reference to post #12
    How can I get color for my
    draw
    object

    Comment


      #17
      Hello Dert66,

      Thanks for your reply.

      This will provide the areaBrush and the outLine brush of the rectangle object:

      Print ("drawBrush: "+(draw as DrawingTools.Rectangle).AreaBrush+" OutLine brush: "+(draw as DrawingTools.Rectangle).OutlineStroke.Brush);

      Comment


        #18
        Code:
           if(CurrentBar < 10) return;
           foreach(DrawingTool draw in DrawObjects.ToList()) {
            if (draw.Name == "Rectangle" && draw.IsUserDrawn) {
             foreach(ChartAnchor myAnchor in draw.Anchors)
                         {
                             Print(myAnchor.Time+" || "+myAnchor.Price);
                         }
             Print ("drawBrush: "+(draw as DrawingTools.Rectangle).AreaBrush+" OutLine brush: "+(draw as DrawingTools.Rectangle).OutlineStroke.Brush);
            }
        }
        This code returns:
        7/25/2019 12:28:25 PM || 3023.32983495146
        7/25/2019 1:25:45 PM || 3019.69744660194
        Indicator 'aaaatest': Error on calling 'OnBarUpdate' method on bar 10: Object reference not set to an instance of an object.

        Comment


          #19
          Hello Dert66,

          Thanks for your reply.

          The code works here, see below.

          Click image for larger version

Name:	Dert66-1.PNG
Views:	165
Size:	144.0 KB
ID:	1065299

          If you would like your script created for you, we can provide references to 3rd party programmers who can provide that service.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          624 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          359 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          562 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          567 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X