Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Type converter list

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

    Type converter list

    I created a typeconverter list but how do I know which one is selected or is all selected.

    I can add and delete the typecast list.


    My question is the list ALL values or how do I select the value I want to use.

    If the list is not the one to use can I make a Dropbox to add and remove items

    #2
    Hello,

    Thank you for the post.

    Generally, a List would be used to contain an unknown number of items, and a type converter would be used to display those items in the property grid correctly. You could later iterate over the list of items but it would not be known which was selected.

    Are you instead looking for an Enum? An enum would generate a dropdown list of items but would be a single selection from that list of items and not an arbitrary list of items which has no selection.

    We have an example of an Enum here: http://ninjatrader.com/support/forum...ead.php?t=3420


    I look forward to being of further assistance.

    Comment


      #3
      Thank you I know how to create enums but can a user have a customization enum list?

      Comment


        #4
        Hello,

        You are able to define whatever names you want in an enum per the example, is this what you are asking?

        If you are asking instead how a user could later change the items in the enum, this is not possible.

        You could have a list as you have already defined but there is no way to know what selection was made. You could have a secondary string input where you could type in a default, then later when iterating over the list look for the typed in default. A list is simply a List not a selection control like an Enum or something with a single value.

        Depending on the complexity of the list you created if this is a list of custom objects you may be able to implement a property that defines it as a default where the user could check a box to make it the default. This would be outside of what I could provide assistance with but may be one item you could look into.



        I look forward to being of further assistance.

        Comment


          #5
          Thank you All I wanted to to is populate the Current Instrument Dropdownlist into my indicator so if there were 4 instruments like NQ 09-17, CL 10-17 etc it would display in my drop down list

          Comment


            #6
            Hello,

            By current instrument drop down, do you mean the recent instruments that you would see in the charts Instrument selector?

            If so, you could just use a Insturment Selector which would allow you to pick a single item from the list of instruments:

            Code:
            [TypeConverter(typeof(NinjaTrader.Gui.Tools.InstrumentSelector))]
            [Display(Name="Select Instrument", GroupName = "Parameters", Order = 0)]
            public Instrument InstrumentInput
            { get; set; }
            
            protected override void OnStateChange()
            {
            	if (State == State.SetDefaults)
            	{
            		InstrumentInput = null;
            	}
            }
            I look forward to being of further assistance.

            Comment


              #7
              Thank You Thank You Thank you. That was EXACTLY what I was looking for

              Comment

              Latest Posts

              Collapse

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