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

How to access 'Input series' property for DisplayName property

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

    How to access 'Input series' property for DisplayName property

    Hi Team,
    Is it possible to access the 'Input series' property, in NinjaScript, for use in the override DisplayName property during State.SetDefaults or State.Configure?
    As the image below shows, stock NinjaTrader indicators are able to access the Input property during State.SetDefaults or State.Configure. How can custom indicators do that?
    Thanks.

    Click image for larger version

Name:	Access to Input series for DisplayName property..png
Views:	399
Size:	43.9 KB
ID:	1079612
    Attached Files
    zacwhitesi
    NinjaTrader Ecosystem Vendor - Shark Indicators

    #2
    Hello zacwhitesi,

    What was the overall goal you had in mind here and where specifically are you trying to display the custom text?

    The internal logic has a much larger scope than your script will, it is aware of other associated variables that your script requires before your NinjaScript will be. Once you configure the script and apply it the platform can translate the information provided into an instance of your script where the properties are populated.

    From the indicator configuration window this would not be possible as you won't have access to the runtime variables there. The display name override also is not called for Configure so any value from runtime that you want would need to be set post configure or when the display name is called in realtime.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Correct about DisplayName not running during Configure. I meant to ask about the override ToString() method, which is called during the initial UI configuration state.
      I want to create a custom name during the initial "indicator configuration window" user configuration. I'd like to control which properties are displayed in the indicator configuration window, along with the Input series property.
      From you answer it sounds like this is not possible.
      zacwhitesi
      NinjaTrader Ecosystem Vendor - Shark Indicators

      Comment


        #4
        Hello zacwhitesi,

        Controlling properties is not the same as the name of your script or ToString from its instance. You can control the Name of your script from as early as SetDefaults however you cannot use variables like the Instrument or Bar series there. The properties you make which show up in the UI are a different concept and can be controlled however you can only control them using input you already have such as the state of another property. Using runtime variables is still not going to be possible in this use case.

        We have an example in the help guide for controlling properties such as toggling them on/off based on a section.



        Keep in mind that using and creating type converters is not NinjaScript specific and is a general C# topic, we have very limited information on this topic aside from the above sample.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Hi Jesse,
          Sorry, but you changed the topic. Let me rephrase the question using the context of the original question (and image).

          I'd like to create a custom name that displays in the indicator configuration window, when the indicator is initially added, that includes the the 'Input series' from the property grid.
          Thanks.

          Side note, I am aware that the DisplayName will override the name in the indicator configuration window when it is opened the second time.
          zacwhitesi
          NinjaTrader Ecosystem Vendor - Shark Indicators

          Comment


            #6
            Hello zacwhitesi,

            I understand the question you had asked and had answered that in post 2, it is not possible what you want to do with the variable you want to use. You can use the DisplayName override to change how the configuration screen displays your item but you cannot use variables it does not have in SetDefaults.

            My reply in post 4 is based on your comments in post 3, I was not changing the topic but providing detail to support your statement;

            I'd like to control which properties are displayed in the indicator configuration window, along with the Input series property.
            You can control the properties shown in the configuration window using the sample I linked however you cannot use the input series before your script is aware of it. You can only use properties which are present during SetDefaults to control other properties. If you instead mean to control the name of your item and how its listed, it would be helpful to just use the term "name" here to avoid confusion as this menu deals with properties.


            Side note, I am aware that the DisplayName will override the name in the indicator configuration window when it is opened the second time
            This may be happening as a result of how it was programmed in your script. Using the following allows for an immediate change in the configuration screen :
            Code:
            public override string DisplayName
            {
            
              get {
            
                  if(State != State.SetDefaults)   return "Text for all other times";
                  else return "My Default Test in the config screen";
                  }
            }
            This assumes you are not trying to use properties which are not present in State.SetDefaults such as the Input and also assumes you are not trying to set it for a later state like configure to bypass any errors of missing variables in SetDefaults.

            Please let me know if I may be of further assistance.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by kempotrader, Today, 08:56 AM
            0 responses
            6 views
            0 likes
            Last Post kempotrader  
            Started by kempotrader, Today, 08:54 AM
            0 responses
            4 views
            0 likes
            Last Post kempotrader  
            Started by mmenigma, Today, 08:54 AM
            0 responses
            2 views
            0 likes
            Last Post mmenigma  
            Started by halgo_boulder, Today, 08:44 AM
            0 responses
            1 view
            0 likes
            Last Post halgo_boulder  
            Started by drewski1980, Today, 08:24 AM
            0 responses
            4 views
            0 likes
            Last Post drewski1980  
            Working...
            X