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

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.
    Chris L.NinjaTrader Customer Service

    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.
        Chris L.NinjaTrader Customer Service

        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.
            Chris L.NinjaTrader Customer Service

            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.
                Chris L.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by port119, Today, 02:43 PM
                0 responses
                1 view
                0 likes
                Last Post port119
                by port119
                 
                Started by Philippe56140, Today, 02:35 PM
                0 responses
                2 views
                0 likes
                Last Post Philippe56140  
                Started by 00nevest, Today, 02:27 PM
                0 responses
                1 view
                0 likes
                Last Post 00nevest  
                Started by Jonafare, 12-06-2012, 03:48 PM
                5 responses
                3,986 views
                0 likes
                Last Post rene69851  
                Started by Fitspressorest, Today, 01:38 PM
                0 responses
                2 views
                0 likes
                Last Post Fitspressorest  
                Working...
                X