Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw ray or line with price marker.

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

    Draw ray or line with price marker.

    I would like to draw a horizontal ray or a line at a specific price value and also have a price marker displayed. I want to move this around to different values periodically (I only want one line displayed at a time, not multiple instances). It might even be nice to hide it at times. I can draw rays and horizontal lines using the draw commands but I can't figure out how to get a price marker displayed with them. Or maybe I can create and indicator with an Oscillator Line, but I don't know how to move it around and I only want the current value plotted, not multiple instances of the oscillator line (if that's the way to go). Any suggestions? Thanks.

    #2
    Here is an idea:
    - check out the "Line" concept (e.g. on the CCI).
    - "Lines" property holds all lines of an indicator
    - a line has a "Value" property. You likely should be able to change that programmatically.
    DierkNinjaTrader Customer Service

    Comment


      #3
      I did try the Line/Lines concept. I can move it around fine, but there is no price marker associated with the line. So, for that purpose the draw methods work just as well for me. For what I am trying to accomplish visually, it would really help me to have price markers associated with with my lines. So, in NT what are the objects that have price markers associated with them? If I am forced to use plots to have price markers then I will but then I have a new question:

      How do I draw a plot across a specified bar interval, say from 20 bars back to the current bar? When I draw the next iteration of the plot over a new bar interval then I want the old one to disappear. I only want the plot over the current interval. Thanks.

      Comment


        #4
        Also, how can I test to see if a Plot has an associated value. e.g. I can use the Set method at certain bars to set a value. But, how can I test the Plot at other bars where I perhaps have not set a value? Do i check for Null? Thanks.

        Comment


          #5
          If you want a Price Marker you need to add a plot like how other indicators do it in the Properties section. To check different values you simply call the plot with an index

          Plot0[0] or Plot0[1] etc.
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            Josh

            Thank you. How do I determine if there is a value in Plot0[5], for example. For instance, say that I have only saved values for certain bars of Plot0. How can I test to see if there is a valid value saved for a particular bar. What does NT store for those bars where I have set no value?

            Comment


              #7
              Checking for Valid Values
              It is possible that you may use a DataSeries object but decide not to set a value for a specific bar. Internally, a dummy value does exist however, if you wanted to check to see if it was a valid value that you set, you can check the following method.


              DataSeries.ContainsValue(int barsAgo)
              Returns a true or false value.
              RayNinjaTrader Customer Service

              Comment


                #8
                Thank you. That is just what I needed.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by zacharydw00, Today, 05:14 PM
                0 responses
                6 views
                0 likes
                Last Post zacharydw00  
                Started by shahabjet1, Today, 04:47 PM
                0 responses
                12 views
                0 likes
                Last Post shahabjet1  
                Started by aligator, Today, 04:32 PM
                0 responses
                10 views
                0 likes
                Last Post aligator  
                Started by timko, Today, 04:02 PM
                0 responses
                9 views
                0 likes
                Last Post timko
                by timko
                 
                Started by asmmbillah, Today, 03:37 PM
                2 responses
                18 views
                0 likes
                Last Post asmmbillah  
                Working...
                X