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 usazencort, Today, 01:16 AM
              0 responses
              1 view
              0 likes
              Last Post usazencort  
              Started by kaywai, 09-01-2023, 08:44 PM
              5 responses
              603 views
              0 likes
              Last Post NinjaTrader_Jason  
              Started by xiinteractive, 04-09-2024, 08:08 AM
              6 responses
              23 views
              0 likes
              Last Post xiinteractive  
              Started by Pattontje, Yesterday, 02:10 PM
              2 responses
              22 views
              0 likes
              Last Post Pattontje  
              Started by flybuzz, 04-21-2024, 04:07 PM
              17 responses
              230 views
              0 likes
              Last Post TradingLoss  
              Working...
              X