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

Listing Configured share services

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

    Listing Configured share services

    Hi There

    Is there a way, similar to the account list, for enumerating configured share services ?

    For accounts we use this:

    Code:
            [TypeConverter(typeof(NinjaTrader.NinjaScript.AccountNameConverter))]
            public string AccountName { get; set; }        
    
    ​
    But I couldn't find something similar for configured share services.

    Thanks

    #2
    Hello Philippe56140,

    There is nothing documented in the help guide of a collection of share services.

    I briefly searched the classes and objects in the Globals and Gui namespaces but was not able to locate anything.

    I have inquired with our development. If I am able to obtain any further information I will follow up here.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea.

      Thanks for your help.
      I found a solution by writing my own TypeConverter.

      Now I can get the list of configured shared services.:

      Click image for larger version

Name:	shared_services.png
Views:	132
Size:	7.0 KB
ID:	1226973

      Comment


        #4
        Originally posted by Philippe56140 View Post
        Hi Chelsea.

        Thanks for your help.
        I found a solution by writing my own TypeConverter.

        Now I can get the list of configured shared services.:

        Click image for larger version

Name:	shared_services.png
Views:	132
Size:	7.0 KB
ID:	1226973
        Would love to do this too, do you mind sharing how you did this?

        Comment


          #5
          Hello,

          I think I found something that will work.

          Code:
          [NinjaScriptProperty]
          [Display(Name="MyShareService",GroupName="Share Service")]
          [PropertyEditor("NinjaTrader.Gui.Tools.AlertsShareServiceEditor")]
          public string MyShareService
          { get; set; }
          Last edited by NinjaTrader_ChelseaB; 02-01-2023, 11:56 AM.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_ChelseaB View Post
            Hello,

            I think I found something that will work.

            Code:
            [NinjaScriptProperty]
            [Display(Name="MyShareService",GroupName="Share Service")]
            [PropertyEditor("NinjaTrader.Gui.Tools.AlertsShareS erviceEditor")]
            public string MyShareService
            { get; set; }
            This worked great, thank you!! (Just had to remove that space in ServiceEditor)
            Last edited by akaSurreal; 02-01-2023, 11:55 AM.

            Comment


              #7
              Originally posted by akaSurreal View Post

              Would love to do this too, do you mind sharing how you did this?
              Did this using this code:

              Code:
              public class ShareServiceNameConverter : StringConverter
                  {
                      public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
                      {
                          List<string> values = new List<string>();
                          lock (Core.Globals.GeneralOptions.ShareServices)
                              foreach (ShareService shareService in Core.Globals.GeneralOptions.ShareServices)
                              {
                                  values.Add(shareService.Name); // Add the name configured by user
                              }
              
                          return new StandardValuesCollection(values);
                      }
              
                      public override bool GetStandardValuesExclusive(ITypeDescriptorContext context) { return true; }
              
                      public override bool GetStandardValuesSupported(ITypeDescriptorContext context) { return true; }
                  }    ​
              Hopefully Chelsea idea seems to be more simple

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by maybeimnotrader, Yesterday, 05:46 PM
              2 responses
              20 views
              0 likes
              Last Post maybeimnotrader  
              Started by adeelshahzad, Today, 03:54 AM
              5 responses
              32 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by stafe, 04-15-2024, 08:34 PM
              7 responses
              32 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by merzo, 06-25-2023, 02:19 AM
              10 responses
              823 views
              1 like
              Last Post NinjaTrader_ChristopherJ  
              Started by frankthearm, Today, 09:08 AM
              5 responses
              22 views
              0 likes
              Last Post NinjaTrader_Clayton  
              Working...
              X