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

Calling State.SetDefaults to reload Property Grid

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

    Calling State.SetDefaults to reload Property Grid

    I've been writing Ninja Indicators for about a year and I struggle most with TypeConverters. I've worked with your samples and I am wondering if there is an easier way. My background is in javascript where manipulating form objects on a UI is so trivial. Is there a way to call a function that reloads the Property Grid with a different set of controls based on the value of a user defined parameter control? For example, if I setup a custom user defined parameter control with 2 options:

    1. Load UI One
    2. Load UI Two,

    Is there a way to attach an event to that selector that reloads the Property Grid with different controls based on the users selection? Sorry if this seems like a silly question. When I look at using TypeConverters it just seems so technical to do something so trivial. Just trying to confirm whether there is or isn't an alternative to TypeConverters. I often create Indicators that need to show different controls based on a selected user configuration. Thanks

    #2
    Hello swcooke,

    Yes, it is possible to add/remove inputs or enable/disable inputs based on the setting of another input, however, this requires using a TypeConverter.

    Below is a link to the SampleIndicatorTypeConverter_NT8 where this type of custom logic is demonstrated.


    In this example look for 'Use Case #1: Show/hide properties based on secondary input'

    I am not aware of any other way of accomplishing this without a custom type converter.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you for your reply. One more related question:

      Instead of creating one indicator with 4 configurations, are there any downsides to creating 4 separate Indicators and putting them in one folder. For example, I noticed if I change the top level namespace by appending my company and name of the group of 4 indicators, I can create a folder in the Indicator window for my company and then a folder for the suite of Indicators which would contain all 4 Indicators. Are there any downsides to organizing like this?

      So each of the 4 Indicators are namespaced like this:

      Code:
      namespace NinjaTrader.NinjaScript.Indicators.NinjaPro.RelativeVolume
      Doing this seems to create a folder for NinjaPro (my company name) and a folder for RelativeVolume (which is the name of the group of 4 Indicators). Then inside of RelativeVolume folder I have all 4 Indicators. Any downsides I should expect when distributing or maintaining if I am organized like this?

      Comment


        #4
        Hello swcooke,

        No, there is nothing wrong with that. That's fine to do.

        You will want to create the folder and move items from within the NinjaScript Editor and not in the filesystem to prevent issues.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          I am not sure I understand. All I have done is changed the namespace. Are you suggesting I actually change the file structure of the Indicators?

          Comment


            #6
            Hello swcooke,

            If you drag a script into a folder, NinjaTrader changes the namespace for you.

            I'm suggesting to use the NinjaScript Editor for these changes instead of modifying the filesystem and in this case editing the namespace directly.

            That said, you did it right. Should be fine.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by geddyisodin, Yesterday, 05:20 AM
            8 responses
            49 views
            0 likes
            Last Post geddyisodin  
            Started by DayTradingDEMON, Today, 09:28 AM
            3 responses
            19 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by Stanfillirenfro, Today, 07:23 AM
            9 responses
            23 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by George21, Today, 10:07 AM
            0 responses
            8 views
            0 likes
            Last Post George21  
            Started by navyguy06, Today, 09:28 AM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Working...
            X