• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add button to Share Service settings

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

    Add button to Share Service settings

    Hi,


    The "Email" share service offers a button for sending a test message (see attached image). From the example code I cannot see how to add such a button to a custom share service. How can I add such a button?



    Regards,
    Attached Files

    #2
    Hello Halmix,

    You can add a button to the UserControlCollection or you can manipulate the WPF elements of the chart.

    Below is a public link to the help guide on UserControlCollection.
    https://ninjatrader.com/support/help...collection.htm

    And a link to a post with examples of adding buttons to the WPF elements on the chart.
    http://ninjatrader.com/support/forum...327#post499327

    To send an email from a script use SendMail() in the .Click handler for the button. Below is a public link to the help guide on SendMail().
    https://ninjatrader.com/support/help...s/sendmail.htm

    Or call Share().
    https://ninjatrader.com/support/help...n-us/share.htm

    The SMTP settings will need to be setup first.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the links. But my problem is not the creation of the button itself, but how to add it to the "Share service" settings view as shown on my initial post's screenshot?

      Comment


        #4
        Hello Halmix,

        Below is a link to a video that demonstrates setting up gmail as an smtp server.
        https://www.screencast.com/t/2VshigfRtcVF

        And a link to a thread with common smtp server settings.
        http://www.ninjatrader.com/support/f...ad.php?t=45339
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          I think we are talking about different things . We can add text, number, date and other fields like this:
          Code:
          #region Properties
          [NinjaScriptProperty]
          [Range(1, int.MaxValue)]
          [Display(Name="RetryCount", Description="The number of retries.", Order=2, GroupName="Parameters")]
          public int RetryCount
          { get; set; }
           #endregion

          I am looking for a way to add a button, e.g. something like this:
          Code:
           [NinjaScriptProperty]
          [Display(Name="MyButton", Description="Click me.", Order=2, GroupName="Parameters")]
          public Event ButtonClicked
          { get; set; }
          #endregion

          Comment


            #6
            Hello Halmix,

            I'm not understanding.

            Are you trying to add a share service to 'Tools > Options > General > Share services' so that you can send emails from a script?

            Do you need help setting up a share service?

            Do you need help adding a button to the chart and sending an email when the button is clicked.

            A button cannot be a property..
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              In my initial post there is a screen shot where a button is marked with a red stroke. I want to add such a button to my own Share Service. When this custom button is clicked then my own test code should be executed.

              Comment


                #8
                Hello Halmix,

                I understand, you are trying to create a custom share service script.

                Adding buttons in a property grid is not officially supported by NinjaTrader Support to do.

                I am happy to submit a feature request on you behalf for the NinjaTrader Development consider creating a supported and documented way of adding buttons to the property grid in the Share Services window from a custom Share script if you would like.

                This thread will remain open for any community members that would like to assist.

                You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our business development follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.

                That said, it might be possible to make a custom PropertyEditor in an Addon file to achieve this.

                Below is a link to a forum post where NinjaTrader_Jesse has posted undocumented and unsupported code that demonstrates.
                https://ninjatrader.com/support/foru...962#post526962
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Thanks a lot for your help . I hope that this feature will be added with a future update.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by dariuszszyc, Today, 09:08 AM
                  2 responses
                  8 views
                  0 likes
                  Last Post dariuszszyc  
                  Started by Sadat, Today, 09:09 AM
                  1 response
                  6 views
                  0 likes
                  Last Post NinjaTrader_JoshG  
                  Started by login_dejavu, Today, 07:57 AM
                  4 responses
                  19 views
                  0 likes
                  Last Post login_dejavu  
                  Started by Lender, Yesterday, 05:15 PM
                  1 response
                  13 views
                  0 likes
                  Last Post NinjaTrader_Jim  
                  Started by rcmcd, Today, 07:52 AM
                  1 response
                  7 views
                  0 likes
                  Last Post NinjaTrader_PatrickG  
                  Working...
                  X