Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Update all global drawing objects from an indicator

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

    Update all global drawing objects from an indicator

    I have a global horizontal line and I want it to be updated across all charts when I change the price level from an indicator. The line is only updated on the chart with this indicator. Is there a method that synchronizes this change across all charts? Sample code below:
    Code:
    NinjaTrader.NinjaScript.DrawingTools.HorizontalLine hline = DrawObjects["@Horizontal Line 12"] as NinjaTrader.NinjaScript.DrawingTools.HorizontalLine;
    hline.StartAnchor.Price = 2400;

    #2
    Hi hurleydood, thanks for your note.

    The anchor properties of drawing tools are read only:


    It would be more straight forward to remove the draw object with the RemoveDrawObject method and draw a new one.

    Please let me know if I can assist any further.

    Comment


      #3
      The documentation for RemoveDrawObjects says it only removes script drawn objects. I want an indicator to have the ability to update user drawn objects. Is there a method to remove also user drawn objects?
      Note: This method will ONLY remove DrawObjects which were created by a NinjaScript object. User drawn objects CANNOT be removed from via NinjaScript

      Comment


        #4
        Hi, thanks for your reply.

        There's no way of removing a user drawn chart object from NinjaScript, only NinjaScript drawn objects are mutable. You can set the .IsVisible property to true to hide them. I'll submit a feature request to track the demand on this feature.

        Kind regards.

        Comment


          #5
          Can put in a feature request to be able to update user drawn objects from an indicator? The DrawingTools seem to be able to update user drawn objects across all charts.

          Comment


            #6
            In the DrawingTools there is a method called OnMouseUp. Any modification to the editingAnchor.Price does not carry changes to the carry changes over to other charts but only the current chart. However OnMouseMove does allow editingAnchor.Price to be modified across all charts. Can you also allow OnMouseUp method to modify editingAnchor.Price across all charts?

            Comment


              #7
              Hi hurleydood, thanks for your patience.

              Sure, I will submit a feature request to allow more control from NinjaScript indicators on user drawn chart objects. I will update this thread here when I have a feature tracking ID.
              Last edited by NinjaTrader_ChrisL; 03-24-2020, 03:58 PM.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              648 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              369 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              108 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              572 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              574 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X