Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to know selected price type?

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

    How to know selected price type?

    I am writing indicator, which utilizes several price components. I want to give the user ability to choose which component to use as basic price data for analysis.

    To write indicator correctly, I must know not only exact data contained in "Input" but also exact source of these data. For example, is "Input" actually equal to "Open", "Close" or something else.

    I have searched all around product documentation but cannot find any variable or function to rely on. Strange enough, DataSeries does not support any text field to identify series name or the like.

    The only crazy idea i have so far, is consequently comparing "Input" point by point with every other series until unique coincedence is discovered. But it is incredibly ridiculous!

    #2
    You want to use Input[0]. Whichever price the user selects will be Input[0].
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      I need to know exactly, which price type represents Input[0] in each particular case. Is it Close[0], Open[0] or something else? How can I find out, which exact price type user has selected in indicator settings?

      Comment


        #4
        Input takes whichever the user selects. Just run a comparison check.

        if (Input[0] == Close[0] && Input[0] != Open[0])
        // then you know exactly what it is
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          What if for given point we have:
          Close[0] = Open[0] = High[0] = Low[0] = some value?
          How can we distinguish exact Input[0] source in this case?

          Comment


            #6
            bzinchenko,

            You only need to make the distinction once. Highly unlikely every point you have will equate the same. Just run the check on several of the early bars. Save out the information and stop checking. The result is not going to change any time afterwards.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Thank You. I have figured out myself same approach, as written in original post. I wanted to be sure that there is no other more elegant solution.

              Comment


                #8
                It appeared finally that class indicator has ready property "PriceType". So it is enough to get this property to know current user selection. Just if anybody else will need the same thing:

                PriceType type = this.PriceType;

                Sorry that i have orelooked it before. But i must admit that tech support is not very aware of class structure too!

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                633 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                364 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                105 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                567 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                568 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X