Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Count number of Horizontal Lines

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

    Count number of Horizontal Lines

    Hi,

    I would like to count the number of horizontal lines on my chart.

    I could count the total number of drawn objects using DrawObjects.Count, but I could not find a way to count the number of horizontal lines.

    My purpose is to detect if more than 1 horizontal line is present.

    Any assistance is greatly appreciated.

    #2
    Try using the example here.

    Comment


      #3
      Originally posted by bltdavid View Post
      Try using the example here.
      Hi thanks for the reply, but the link is not working

      Comment


        #4
        Interesting, it works for me.

        That link should be going here,

        Comment


          #5
          Hello Rainmakersg,

          Apologies, our forum is having technical issues that is currently being worked out by our IT.

          The url bltdavid was trying to provide is in text below.
          Code:
          https://ninjatrader.com/support/helpGuides/nt8/chartobjects.htm
          You could also loop through the DrawObjects collection and compare the object to HorizontalLine.
          Code:
          https://ninjatrader.com/support/helpGuides/nt8/drawingtools_drawobjects.htm
          https://ninjatrader.com/support/helpGuides/nt8/horizontalline.htm
          Increment an Int (integer) to count the number of times this matches in the loop.
          Code:
          https://ninjatrader.com/support/forum/forum/ninjatrader-8/platform-technical-support-aa/104533-strategy-builder-syntax?p=812260#post812260
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Thanks so much, I will give it a try.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Mindset, 04-21-2026, 06:46 AM
            0 responses
            44 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by M4ndoo, 04-20-2026, 05:21 PM
            0 responses
            58 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by M4ndoo, 04-19-2026, 05:54 PM
            0 responses
            35 views
            0 likes
            Last Post M4ndoo
            by M4ndoo
             
            Started by cmoran13, 04-16-2026, 01:02 PM
            0 responses
            95 views
            0 likes
            Last Post cmoran13  
            Started by PaulMohn, 04-10-2026, 11:11 AM
            0 responses
            59 views
            0 likes
            Last Post PaulMohn  
            Working...
            X