Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Builder Actions - Share to Email Function

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

    Strategy Builder Actions - Share to Email Function

    I have my share (email) setup, and I get my emails, but when I use it in the Strategy Builder, I can't seem to get a 'Subject:' line. The email I receive states (No Subject) even though I've added a subject (string). Is there an instructional guide for this specific use or is there a known issue? Thanks

    #2
    Hello Darkslide_Tom,

    Thank you for your post.

    Are you using Share() or SendMail()?

    The Strategy Builder can only use the following overload for Share(), which does not allow you to specify a subject, only a message (which is the body of the email):

    Share(string serviceName, string message, string screenshotPath)


    If you wanted to specify a subject, you would need to unlock the code and use one of the following overloads:

    Share(string serviceName, string message, object[] args)

    Share(string serviceName, string message, string screenshotPath, object[] args)


    From the Help Guide:

    "2.For the default NinjaTrader share adapters, the "args" array represents the following:

    ▪Mail share service:

    •args[0] = A string representing the email "To" field,

    •args[1] = A string representing the email "Subject" field"

    The Help Guide page also has sample code demonstrating.



    Please let us know if you have any further questions.
    Gaby V.NinjaTrader Customer Service

    Comment


      #3
      Would I modify the existing: Share(@"Gmail", Convert.ToString(Alert), @"", new object[] {@"[email protected]", @"", @"@INSTRUMENT"}); OR would I create a separate line under this existing code (ex: Share("Gmail", "Test Message", new object[]{ "[email protected]", "Test Subject Line" })?
      Last edited by Darkslide_Tom; 03-25-2025, 08:18 AM. Reason: removed unintentional emoji

      Comment


        #4
        If you only want to send one email via Share() you would modify the existing line of code with the overload that allows you to specify the subject line.

        Please note that this: Share("Gmail", "Test Message", new object[]{ "[email protected]", "Test Subject Line" })

        is just sample code, and you would replace the parameters with your desired values (i.e. your shareservice, email, to email and subject).
        Gaby V.NinjaTrader Customer Service

        Comment


          #5
          Thanks for the help! I was able to add the subject and a dynamic instrument.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by iantriestrading, Yesterday, 01:39 PM
          5 responses
          27 views
          0 likes
          Last Post iantriestrading  
          Started by trendisyourfriend, 05-25-2023, 09:54 AM
          10 responses
          169 views
          0 likes
          Last Post Curerious  
          Started by iantriestrading, Today, 04:12 PM
          0 responses
          16 views
          0 likes
          Last Post iantriestrading  
          Started by Adamel, Today, 03:47 PM
          0 responses
          13 views
          0 likes
          Last Post Adamel
          by Adamel
           
          Started by raysinred, 04-06-2025, 01:52 PM
          15 responses
          137 views
          0 likes
          Last Post NinjaTrader_Helom  
          Working...
          X