Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

check if input exists

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

    check if input exists

    I was trying but cant find any way, to find the `user properties` element with IDE.

    i.e. I want to get the list of Properties my indicator has (i.e. properties which is set by user in Properties window, like : SMA Length =14, or other typical properties of indi).

    How to get that?

    this.Owner.InputBindings

    or which code access the those elements?
    Last edited by ttodua; 05-08-2018, 07:25 AM.

    #2
    Hello TazoTodua,

    Thank you for your note.

    Yes, you could use this.IndicatorName( and they should be displayed.

    See the attached screens hot where I demonstrate this for the SMA.

    Please let us know if you need further assistance.
    Attached Files
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Alan, I think there is misunderstanding.

      In which variable/property I get all those input lists of indicator?

      i.e.

      this.SMA.inputs ?

      or

      this.SMA.properties ?

      or?
      (SMA has only `period` input, however, lets say an indi that has 5-10 different kind of user inputs).

      Comment


        #4
        Hello TazoTodua,

        Thank you for the clarification, in this case there would not be a collection of properties that the user can set, the object would have properties in general but they would not be contained in a specific collection. You could research "C# how to find properties on an object" for further details on how to accomplish this. Finding properties on an object would not be specific to NinjaTrader but instead is a C# concept and with that would be outside of the scope in which I could provide further assistance.

        From the world of PHP I have decided to give C# a go. I've had a search but can't seem to find the answer of how to do the equivalent to this. $object = new Object(); $vars = get_class_vars(get_c...


        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          Alan,
          thanks, but YES, i know how to get all properties/fields


          foreach(var prop in indicator_name.GetType().GetFields() ) { //or GetProperties()
          Print ( prop.Name );
          }


          But I am interested, which ones are named with [Display(.....)] and percepted like user input. I am sure, NT does something, as it decides which parameters are shown in window. however, ok, not quite important for me at this moment, just wanted to check. thnxs

          Comment


            #6
            Hello TazoTodua,

            Thank you for your patience.

            Attached an example of how you can pull the properties that Display. This does include additional properties outside the custom user defined input parameters.

            Please let me know if you have any questions.
            Attached Files

            Comment


              #7
              NICE! thnks

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              651 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              370 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              109 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              574 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              577 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X