Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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);
      Paul H.NinjaTrader Customer Service

      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:	128
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.
          Paul H.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by burtoninlondon, Today, 12:38 AM
          0 responses
          10 views
          0 likes
          Last Post burtoninlondon  
          Started by AaronKoRn, Yesterday, 09:49 PM
          0 responses
          14 views
          0 likes
          Last Post AaronKoRn  
          Started by carnitron, Yesterday, 08:42 PM
          0 responses
          11 views
          0 likes
          Last Post carnitron  
          Started by strategist007, Yesterday, 07:51 PM
          0 responses
          13 views
          0 likes
          Last Post strategist007  
          Started by StockTrader88, 03-06-2021, 08:58 AM
          44 responses
          3,983 views
          3 likes
          Last Post jhudas88  
          Working...
          X