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

Seeing Manually created objects in script object ToList

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

    Seeing Manually created objects in script object ToList

    I create a horizontal line manually, it shows in object list, but in script the object Count is 0 and the ToList is empty? How to fix?

    #2
    Hello kenz987, thanks for your post.

    In the past, I made a script that detects horizontal lines on the chart. This demonstrates how to read all horizontal lines on the chart:

    https://ninjatraderecosystem.com/use...izontal-lines/

    See the OnRender method for the draw object detection.

    Kind regards,
    -ChrisL
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thank You Chris, That was very helpful. Is it possible to delete the line in this code?

      Comment


        #4
        Hello, thanks for your reply.

        We do have the RemoveDrawObject method but it will only work for NinjaScript drawn objects, manually drawn objects can not be removed through a script.
        https://ninjatrader.com/support/help...drawobject.htm

        Kind regrards,
        -ChrisL
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          The real question is Why do you not show these in the DrawObjects ToList()??? I would have never found this digging thru the help.
          Thank You.

          Comment


            #6
            One more note: It would really help us struggling to find help and save you guys lots of time helping guys like me that know something should be there but is not, if you would just stop hiding things from the Editor . . . like for the HorizontalLine ,StartAnchor , , , and IsLocked !!

            Comment


              #7
              Hello, thanks for your reply.

              The ChartObjects array will hold user drawn and manually drawn items:
              https://ninjatrader.com/support/help...artobjects.htm

              Intellisense in the editor will show all the properties of the assembly you are working with as well.

              Kind regards.
              Chris L.NinjaTrader Customer Service

              Comment


                #8
                1) Yes ChartObjects on the Panel, not DrawingObjects.ToList()
                2) No StartAnchor and IsLocked do not show
                Thats why I started this thread to waste time for both of us.
                But you showed a good work around. Thanks.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by FramiThur, Today, 10:57 PM
                0 responses
                1 view
                0 likes
                Last Post FramiThur  
                Started by HTrader, Today, 09:12 PM
                2 responses
                6 views
                0 likes
                Last Post HTrader
                by HTrader
                 
                Started by firstlanetech, Today, 08:56 PM
                1 response
                4 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by robbersdog, Today, 07:55 AM
                1 response
                7 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by SuperDude123, Today, 09:08 AM
                2 responses
                39 views
                0 likes
                Last Post SuperDude123  
                Working...
                X