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

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 love2code2trade, 04-17-2024, 01:45 PM
              4 responses
              31 views
              0 likes
              Last Post love2code2trade  
              Started by cls71, Today, 04:45 AM
              2 responses
              10 views
              0 likes
              Last Post eDanny
              by eDanny
               
              Started by proptrade13, Today, 11:06 AM
              0 responses
              4 views
              0 likes
              Last Post proptrade13  
              Started by kulwinder73, Today, 10:31 AM
              1 response
              10 views
              0 likes
              Last Post NinjaTrader_Erick  
              Started by RookieTrader, Today, 09:37 AM
              3 responses
              15 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Working...
              X