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 Waxavi, Today, 02:10 AM
                0 responses
                2 views
                0 likes
                Last Post Waxavi
                by Waxavi
                 
                Started by TradeForge, Today, 02:09 AM
                0 responses
                6 views
                0 likes
                Last Post TradeForge  
                Started by Waxavi, Today, 02:00 AM
                0 responses
                2 views
                0 likes
                Last Post Waxavi
                by Waxavi
                 
                Started by elirion, Today, 01:36 AM
                0 responses
                4 views
                0 likes
                Last Post elirion
                by elirion
                 
                Started by gentlebenthebear, Today, 01:30 AM
                0 responses
                4 views
                0 likes
                Last Post gentlebenthebear  
                Working...
                X