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

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.

      I've drawn a textbox manually and I would like to update it's position via my strategy. Basically I want to be able to edit the text on the chart so I can pass


      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:



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

                  Comment


                    #10
                    Can an alert from a drawing object trigger a trade?

                    Comment


                      #11
                      Can an alert...sound and order be place on a manual drawn vertical line? When price gets to it it triggers?

                      Comment


                        #12
                        What setting would be used for price touching vertical line cross inside, outside or equal to set an alert when price touches vertical line?

                        Comment


                          #13
                          Hello JTizz,

                          Thank you for your several replies.

                          Yes, an Alert can trigger an order when it goes off. To have an alert trigger an order, in the Alerts window you would need to click Add under Actions, then select Submit an order and set up your order. You can see the various options for actions as well as the settings used to submit an order here:



                          Yes, alerts can be triggered when a price touches or crosses a manually drawn object. If you want it to alert only when the price touches the line, you would want to use equal to set the alert.

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

                          Comment


                            #14
                            Vertical line. I tried all the options but they appear to be for up and down movements not sideways price movement.

                            Comment


                              #15
                              Click image for larger version

Name:	vertical line sell 2.jpg
Views:	335
Size:	34.3 KB
ID:	1131777

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Jon17, Today, 04:33 PM
                              0 responses
                              1 view
                              0 likes
                              Last Post Jon17
                              by Jon17
                               
                              Started by Javierw.ok, Today, 04:12 PM
                              0 responses
                              6 views
                              0 likes
                              Last Post Javierw.ok  
                              Started by timmbbo, Today, 08:59 AM
                              2 responses
                              10 views
                              0 likes
                              Last Post bltdavid  
                              Started by alifarahani, Today, 09:40 AM
                              6 responses
                              41 views
                              0 likes
                              Last Post alifarahani  
                              Started by Waxavi, Today, 02:10 AM
                              1 response
                              20 views
                              0 likes
                              Last Post NinjaTrader_LuisH  
                              Working...
                              X