Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get Anchor Prices from object drawn by Indicator

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

    #16
    Hello facuevasm,

    This is normal, an indicator added by a strategy cannot be manually configured, so no properties may show.

    If the indicator does not add a plot with AddPlot(), call Update() to get the script to update.

    Attached is an example.
    Attached Files
    Chelsea B.NinjaTrader Customer Service

    Comment


      #17
      Thank you Chelsea. Now Im looping throw the objects drawn by myIndi, but I cant get the price level of the rectangles. How I can loop from each one and retrieve a price? Im actually looping from each anchor for each draw, but Price shows on zero.

      foreach (DrawingTool draw in myIndi.DrawObjects.ToList())
      {

      Print("Tag: " + draw.Tag + " Name: " + draw.Name);
      foreach(ChartAnchor anchor in draw.Anchors)
      {
      Print("Price: " + anchor.Price);
      }



      }

      Click image for larger version

Name:	Screenshot.PNG
Views:	131
Size:	7.9 KB
ID:	1209386

      Thank you Chelsea!

      Comment


        #18
        Hello facuevasm,

        Cast as a Rectangle and you print the rectangle.StartAnchor and rectangle.EndAnchor as defined in the help guide.


        Below is a link to a forum post about getting price levels from drawing objects that have price levels.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #19
          Originally posted by facuevasm View Post
          Thank you Chelsea. Now Im looping throw the objects drawn by myIndi, but I cant get the price level of the rectangles. How I can loop from each one and retrieve a price? Im actually looping from each anchor for each draw, but Price shows on zero.

          foreach (DrawingTool draw in myIndi.DrawObjects.ToList())
          {

          Print("Tag: " + draw.Tag + " Name: " + draw.Name);
          foreach(ChartAnchor anchor in draw.Anchors)
          {
          Print("Price: " + anchor.Price);
          }



          }

          Click image for larger version

Name:	Screenshot.PNG
Views:	131
Size:	7.9 KB
ID:	1209386

          Thank you Chelsea!
          I had to do some digging, but this post help me pull anchors from the draw objects. Thanks.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          90 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          137 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          68 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          120 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          69 views
          0 likes
          Last Post PaulMohn  
          Working...
          X