• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawing objects

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

    Drawing objects

    Can code be developed where one drawing object be attached to another?

    #2
    Where once attached they move together.

    Comment


      #3
      Hello JTizz,

      Thank you for your post.

      Are you referring to manually drawn drawing objects? Theoretically this may be possible - you'd need to check the anchors of each drawing tool and then when one changes, modify the other drawing object(s). This would get fairly complicated quickly, however, as you'd need to specifically code it to modify the specific type of drawing object, and then even more complicated if you want it to monitor multiple objects. Here's a link to a forum post that shows how the price anchor of a line drawing object could be modified from a script that you could use as a jumping off point to try this; however, it would be extremely complex if even possible.

      https://ninjatrader.com/support/foru...10#post1042310

      Please let us know if we may be of further assistance to you.
      Kate W.NinjaTrader Customer Service

      Comment


        #4
        I have created drawing objects that build off each other and know about each other. When one changes, it notifies its attachments that it has changed. One important aspect to making this work was adding a GUID to every drawing object involved in the connection. This is important for re-establishing connections from NinjaTrader's save/load functionality.

        Comment


          #5
          What is GUID? GUID to every drawing object

          Comment


            #6
            Is there a way to have a drawing object attached to current price so the object moves with price?

            Comment


              #7
              GUID is a global unique identifier. Its a common mechanism as part of the C# system runtime that allows one to create unique ID's. https://docs.microsoft.com/en-us/dot...tframework-4.8

              In order to have drawing objects reference each other, they need a mechanism that allows each object to find the attached object when loading a workspace. I also added a global look up table that maps GUIDs to drawing objects. The drawing objects register with the table when they are created or loaded, and use the table to find the associated drawing object. You also need to handle what happens if the associated drawing object is deleted. It is complicated but it can be done.

              Comment


                #8
                Can trades be taken off of drawing objects?

                Comment


                  #9
                  Hello JTizz,

                  Thank you for your reply.

                  The easiest way to submit an order based on a drawing object would be with an alert. Here's a link to our help guide with an example of creating an alert that plays a sound and submits an order based on the price crossing out of the drawing object's area:

                  https://ninjatrader.com/support/help...erDrawnObjects

                  Please let us know if we may be of further assistance to you.
                  Kate W.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by jhontorres, Today, 12:16 PM
                  1 response
                  6 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by KarstenKafl, 07-16-2020, 12:38 AM
                  8 responses
                  42 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by DieSlower, Yesterday, 11:02 PM
                  1 response
                  7 views
                  0 likes
                  Last Post NinjaTrader_Kate  
                  Started by TomTownsend, Today, 11:35 AM
                  3 responses
                  15 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by frankduc, Today, 11:17 AM
                  2 responses
                  17 views
                  0 likes
                  Last Post frankduc  
                  Working...
                  X