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

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 Carolscogginsi, Yesterday, 10:45 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post Carolscogginsi  
                  Started by RaddiFX, Yesterday, 10:15 AM
                  2 responses
                  15 views
                  0 likes
                  Last Post RaddiFX
                  by RaddiFX
                   
                  Started by patrickmlee007, Yesterday, 09:33 AM
                  2 responses
                  18 views
                  0 likes
                  Last Post patrickmlee007  
                  Started by magnatauren, 08-15-2020, 02:12 PM
                  5 responses
                  208 views
                  0 likes
                  Last Post RaddiFX
                  by RaddiFX
                   
                  Started by rene69851, 05-02-2024, 03:25 PM
                  1 response
                  24 views
                  0 likes
                  Last Post rene69851  
                  Working...
                  X