Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Changing Global Object Properties

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

    Changing Global Object Properties

    Hello,

    A bunch of the indicators offered by Ocean Trading Indicators interact with Draw Objects. Some objects are global objects. When changing the properties of global Draw Objects, only the objects on the current chart are changed.

    How does one refresh charts globally?

    Best regards

    Unsuitable
    Ocean Trading Indicators
    Unsuitable
    NinjaTrader Ecosystem Vendor - Ocean Trading Indicators

    #2
    Hello Unsuitable,

    Note, this does not affect manually drawn objects, which automatically propagate changes to other charts.

    See this example that uses undocumented code to propagate changes to other instances of global drawing objects.
    https://ninjatrader.com/support/foru...59#post1179659
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello NinjaTrader_ChelseaB,

      Thank you for forwarding the link. If I understand correctly, lines 222-245 would go through all charts to find a specific type of drawing tool. In my case, find a chart object with a specific tag would work. Then update those values. Could also go through charts that only have the same instrument as well to cut down on processing power.

      I noticed the drawing states are modified often. This may be a major oversight, but is that important when changing the visual properties of an object? The documentation on the Drawing States only mention the anchors, nothing about the properties such as color and thickness,

      Best regards,

      Unsuitable
      Ocean Trading Indicators
      Unsuitable
      NinjaTrader Ecosystem Vendor - Ocean Trading Indicators

      Comment


        #4
        Hello Unsuitable,

        Global Drawing Objects will only appear on charts of the same instrument.

        The DrawingState is linked specifically to the anchors. When the object is first drawing its building and the clicks place the anchors. When editing this means the object is selected so an anchor can be moved. When moving this means an anchor is being moved.

        The visual properties are not changing during these times.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hello Chelsea,

          Gotcha, thank you for the clarification.

          To confirm, to propagate global object changes that an indicator does, the code has update the object manually on each chart.

          Best regards,

          Unsuitable
          Unsuitable
          NinjaTrader Ecosystem Vendor - Ocean Trading Indicators

          Comment


            #6
            I noticed that just moving the object will force update the changes to other charts.
            Unsuitable
            NinjaTrader Ecosystem Vendor - Ocean Trading Indicators

            Comment


              #7
              Originally posted by Unsuitable View Post
              I noticed that just moving the object will force update the changes to other charts.
              Also simply copying the object after the update would propagate the changes globally.
              Unsuitable
              NinjaTrader Ecosystem Vendor - Ocean Trading Indicators

              Comment


                #8
                Hello Unsuitable,

                The DrawingToolContextMenuExampleIncreaseDecreasePrice example is looping through NinjaTrader.Core.Globals.AllWindows and getting all objects on all ChartControls.

                Are you reviewing the code of this and finding this is not suffiecient for your needs.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Hello Chelsea,

                  The code loops through the charts but not tabs if that makes sense. I may be missing something, but it only returns the active chart. Referencing lines 222 to 243 and specifically line 235. This only retrieves the active ChartControl. I also posted a question about looping through tabs, and Emily redirected me to another thread. That should work.

                  Hi, I was wondering if there's a way to iterate through (or refer to) open chart windows, other than the currently selected chart? I can iterate through tabs


                  Thanks
                  Unsuitable
                  NinjaTrader Ecosystem Vendor - Ocean Trading Indicators

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  672 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  379 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  111 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  577 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  582 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X