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:	124
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:	124
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 NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          62 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          134 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          75 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          45 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          50 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X