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

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.

    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 frankthearm, Today, 09:08 AM
                3 responses
                9 views
                0 likes
                Last Post NinjaTrader_Clayton  
                Started by yertle, Today, 08:38 AM
                5 responses
                15 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by adeelshahzad, Today, 03:54 AM
                3 responses
                16 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by bill2023, Yesterday, 08:51 AM
                6 responses
                27 views
                0 likes
                Last Post NinjaTrader_Erick  
                Started by NinjaTrader_ChelseaB, 01-08-2017, 06:59 PM
                80 responses
                19,667 views
                5 likes
                Last Post NinjaTrader_ChelseaB  
                Working...
                X