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

How to refer to the y value a drawn horizontal line?

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

    How to refer to the y value a drawn horizontal line?

    I have drawn horizonal lines that I need to refer to their y values for using methods such as CrossAbove,etc
    Last edited by Pete77; 06-04-2021, 12:36 PM.

    #2
    Hello Pete77,

    Thanks for your post.

    The easy way would be for your indicator to save the Open price of the 8:30 bar. But I don't know what your subsequent lines are developed from but again if you can pull those from the price data would be the best.

    Otherwise, you can loop through the drawing objects on the chart, find the lines of interest and then pull the Y values of those draw objects.
    Please see the help guide here for an example: https://ninjatrader.com/support/help...rawobjects.htm

    Paul H.NinjaTrader Customer Service

    Comment


      #3
      ,I have drawn horizonal lines that I need to refer to their y values for using methods such as CrossAbove,etc. Is this possible?

      Comment


        #4
        Hello Pete77,

        Thanks for your reply.

        Yes, "you can loop through the drawing objects on the chart, find the lines of interest and then pull the Y values of those draw objects.
        Please see the help guide here for an example: https://ninjatrader.com/support/help...rawobjects.htm"
        Paul H.NinjaTrader Customer Service

        Comment


          #5

          Thanks for the reply. Glad to hear what I want to do is possible!

          I have been trying to save opening price in a variable "openPrice" but so far no luck.
          I will some more look at the information you gave me




















          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Graci117, Today, 11:40 PM
          0 responses
          5 views
          0 likes
          Last Post Graci117  
          Started by BIOK.NT, Today, 01:56 PM
          2 responses
          11 views
          0 likes
          Last Post BIOK.NT
          by BIOK.NT
           
          Started by i2ogu3, Today, 11:31 PM
          0 responses
          4 views
          0 likes
          Last Post i2ogu3
          by i2ogu3
           
          Started by RDTrader16, Today, 10:19 PM
          0 responses
          10 views
          0 likes
          Last Post RDTrader16  
          Started by gemify, 03-08-2023, 08:02 AM
          9 responses
          150 views
          0 likes
          Last Post culpepper  
          Working...
          X