Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

instrument name to email in strategy builder

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

    instrument name to email in strategy builder

    I am trying to email the primary and secondary instrument names of my chart using strategy builder in Ninjatrader 8. I'd like to include the instrument name in the body of the email alert. I tried using send mail in strategy builder and filled the text field with:

    String 0 set to

    Instrument.MasterInstrument.Name

    I also tried using

    Instruments[1].FullName

    Instead of getting the ticker symbol I just get the above code sent to my email. Is there any way I can get the ticker symbols sent in my alerts in strategy builder without unlocking the code? Thanks

    #2
    Hi, thanks for your question.

    If this code is going in between quotations it will be compiled into a string. You can set string variables and use the variables. e.g.

    string mystring = Instruments[1].FullName

    Then use mystring withing SendMail as the string parameter.

    Please let me know if this does not resolve your inquiry.

    Comment


      #3
      I'm still getting the code and not the actual instrument name in my email.

      Comment


        #4
        Hi jerblaster23, thanks for your reply.

        Unfortunately, the Instrument name property is not available through the builder. In the builder, you must use the condition builder to generate code. When you assign a string in the strategy builder it will set it as a string literal. The strategy would need to be unlocked to use this e.g.

        SendMail("[email protected]", "TestEmail", Instruments[1].FullName);

        Please let me know if I can assist any further.

        Comment


          #5
          I was able to send the instrument name successfully by unlocking the code. However I am not able to send the second instrument name. The second instrument is not part of the strategy and is simply an additional data series. I'd like to send the instrument name of this second data series as well. Can this be done?

          Comment


            #6
            Hi jerblaster23, thanks for your reply.

            I apologize, but I realized we are in the NinjaTrader 7 forum. NinjaTrader 8 does have an "Instruments" array, but NinjaTrader 7 does not, unfortunately. The value would need to be input with a user input variable when the strategy is set up.

            Kind regards.

            Comment


              #7
              My bad, I posted in the wrong section but I am using Ninjatrader 8. Can I use the instruments array feature? If so how?

              Comment


                #8
                Hi, thanks for your reply.

                We have the Instruments array that holds every instrument a script is using:


                If you have added other instruments to your script with AddDataSeries, the Instruments array will hold all added instruments.

                Please let me know if I can assist any further.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                556 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                324 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                101 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                545 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                547 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X