Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Dynamic Enum List of Avaible Accounts

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

    Dynamic Enum List of Avaible Accounts

    Hello,

    I'm looking to get the Account size of a specific account chosen by the user. Is it possible to create an enum that gets populated when the indicator is added to the chart which the user can select from? I'm leaning towards yes, however, this may take a bit too much work. Would a user-submitted text field with the account name be a simpler and more streamlined approach to this problem?

    Thanks
    Unsuitable
    NinjaTrader Ecosystem Vendor - Ocean Trading Indicators

    #2
    Hello Unsuitable,

    Thanks for your post.

    While this is undocumented and not officially supported, you could consider using the following TypeConverter on a string. I have attached an example which uses it.

    Code:
    [TypeConverter(typeof(NinjaTrader.NinjaScript.AccountNameConverter))]
    public string AccountName { get; set; }
    We look forward to assisting.
    Attached Files
    JimNinjaTrader Customer Service

    Comment


      #3
      Hello Jim,

      Aha that works perfectly! Quite a bit more simple than I thought it would be. This is out of the scope of the question, but will this cause compiling issues as it's using the NinjaTrader namespace?

      Thanks
      Last edited by Unsuitable; Yesterday, 12:14 PM.
      Unsuitable
      NinjaTrader Ecosystem Vendor - Ocean Trading Indicators

      Comment


        #4
        Hello Unsuitable,

        I have not had issue including the example script in a DLL or compiling in Visual Studio.
        JimNinjaTrader Customer Service

        Comment


          #5
          Ok great, thanks for the help!
          Unsuitable
          NinjaTrader Ecosystem Vendor - Ocean Trading Indicators

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by nutmame1, Today, 08:26 PM
          0 responses
          8 views
          0 likes
          Last Post nutmame1  
          Started by dr0832, Today, 07:02 PM
          0 responses
          13 views
          0 likes
          Last Post dr0832
          by dr0832
           
          Started by mlurskint8, Today, 05:27 PM
          3 responses
          19 views
          0 likes
          Last Post NinjaTrader_ShawnB  
          Started by SteveTheCPA, Today, 04:54 PM
          0 responses
          10 views
          0 likes
          Last Post SteveTheCPA  
          Started by Unsuitable, Today, 02:42 PM
          2 responses
          14 views
          0 likes
          Last Post Unsuitable  
          Working...
          X