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

Account and Instrument Selectors in Property Grids

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

    Account and Instrument Selectors in Property Grids

    How would one incorporate Account and Instrument Selectors in Property Grids? The intention is to allow an Account or Instrument to be selected from the relevant selector as a property of an AddOn.

    EDIT Update:

    I've found this for Instruments and it works well enough:
    Code:
    [PropertyEditor("NinjaTrader.Gui.Tools.InstrumentPicker")]
    public Instrument MyInstrument{ get; set; }
    However, it displays Instruments in the selector with "Default" or an Exchange; e.g. "EURAUD Default" or "BTCGBP Gdax".

    How does one display just the Instrument name alone?

    ... and Accounts?

    Thanks.
    Last edited by jeronymite; 07-18-2021, 12:08 AM.
    Multi-Dimensional Managed Trading
    jeronymite
    NinjaTrader Ecosystem Vendor - Mizpah Software

    #2
    Hello jeronymite,

    Code:
    [TypeConverter(typeof(NinjaTrader.NinjaScript.AccountNameConverter))]
    public string AccountName { get; set; }
    Code:
    [NinjaScriptProperty]
    [TypeConverter(typeof(NinjaTrader.Gui.Tools.InstrumentSelector))]
    [Display(Name="Select Instrument", GroupName = "Parameters", Order = 0)]
    public NinjaTrader.Cbi.Instrument InstrumentInput
    { get; set; }
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks, Chelsea.

      The Accounts example works well.

      The Instrument example still displays the Instrument name with "Default" or an Exchange name. How can one eliminate the display of "Default" or an Exchange name? In other words, only the Instrument name alone.

      Thanks.
      Multi-Dimensional Managed Trading
      jeronymite
      NinjaTrader Ecosystem Vendor - Mizpah Software

      Comment


        #4
        Hello jeronymite,

        I'm not seeing a way to do that. It might be necessary to create a custom List<string> input of the instrument names and make a property of this.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thanks, Chelsea.

          The custom List is not suitable, sadly, since any Instrument is possible in this AddOn, which is for commercial use.

          The InstrumentSelector does not display the extra information when added to an AddOn window, so it is "interesting" that it does so here in a Property Grid.

          Thanks.
          Multi-Dimensional Managed Trading
          jeronymite
          NinjaTrader Ecosystem Vendor - Mizpah Software

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CortexZenUSA, Today, 12:53 AM
          0 responses
          1 view
          0 likes
          Last Post CortexZenUSA  
          Started by CortexZenUSA, Today, 12:46 AM
          0 responses
          0 views
          0 likes
          Last Post CortexZenUSA  
          Started by usazencortex, Today, 12:43 AM
          0 responses
          2 views
          0 likes
          Last Post usazencortex  
          Started by sidlercom80, 10-28-2023, 08:49 AM
          168 responses
          2,262 views
          0 likes
          Last Post sidlercom80  
          Started by Barry Milan, Yesterday, 10:35 PM
          3 responses
          10 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Working...
          X