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 GLFX005, Today, 03:23 AM
              0 responses
              1 view
              0 likes
              Last Post GLFX005
              by GLFX005
               
              Started by XXtrader, Yesterday, 11:30 PM
              2 responses
              11 views
              0 likes
              Last Post XXtrader  
              Started by Waxavi, Today, 02:10 AM
              0 responses
              6 views
              0 likes
              Last Post Waxavi
              by Waxavi
               
              Started by TradeForge, Today, 02:09 AM
              0 responses
              11 views
              0 likes
              Last Post TradeForge  
              Started by Waxavi, Today, 02:00 AM
              0 responses
              2 views
              0 likes
              Last Post Waxavi
              by Waxavi
               
              Working...
              X