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

script sendmail()

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

    script sendmail()

    Hi
    i read a lot of thing on the forum but not the answer of my 2 questions :

    1st : the script for sendmail on the guide is: SendMail("[email protected]", "[email protected]", "Trade Alert", "Buy ES");
    i want to write on the subject "Trade Alert on Apple" for example, and Apple is the equitie where the strategy is running... what is the script to integrate the name of this equities on the subject of the email ?

    2sd : i read on the guide than the script sendmail() only works on real time... but if i get end of day data from Kinetic or yahoo, i run all my strategies on the 500 equities of the S&P after the daily close and the imported data from Kinetic or Yahoo... the email will be send ?

    thanks for the answer.
    Thomas

    #2
    Hi Thomas,

    You can use property Instrument.MasterInstrument.Name for this.

    No, the free yahoo and Kinetick end of day connections do not provide real time data, so will not see send mail processed using them. Please see the following link for our providers that offer real time data:
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      excuse me but i'm a newbee, the synthax should be:
      SendMail ("[email protected]","myemai@yahoo.fr,"Instrument.MasterInstrument.Name", "Buy this equity !");
      i tried that the object of the email give me Instrument.MasterInstrument.Name

      i don't understand how to use your synthax

      Comment


        #4
        You need it without quotation marks.
        SendMail ("[email protected]","[email protected]", Instrument.MasterInstrument.Name,"Buy this equity !");
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Hi

          how can i copied a second adress to send an email in the SendMail fonction ?

          like adress 1 and adress 2 ?

          Comment


            #6
            Hello Thomas79,
            If you are trying to CC another email as in send an email to two different emails, there is currently no documented support for multiple emails with the SendMail() method. So in the case that you want to send an email to two different emails you would need to make a second SendMail() call.

            Code:
            SendMail ("[email protected]","[email protected]", Instrument.MasterInstrument.Name,"Buy this equity !");
            SendMail ("[email protected]","[email protected]", Instrument.MasterInstrument.Name,"Buy this equity !");
            You should be able to use a ; to seperate email address in the string, although this is undocumented.
            Please let me know if I may be of additional assistance.
            Last edited by NinjaTrader_Jesse; 05-05-2014, 10:57 AM.
            JesseNinjaTrader Customer Service

            Comment


              #7
              Thx Jesse,

              on the subject place i write to get the name of the market.

              but i would like on the core of the email have the data series of the strategie, because i run this strategie on a lot of equity on daily, 60 minutes, 30 minutes and 15 minutes.

              so i need to know also the data series, is it possible ?

              thx

              Comment


                #8
                Hello Thomas79,

                I believe you are referring to what the time frame of the chart is this correct?

                If you are trying to get the bar type I.E. 30 minute, 5 minute, etc. then you can use the following. This would make a string that has the value and id for example 1 minute or 30 tick

                Code:
                Bars.Period.Value.ToString() + Bars.Period.Id.ToString()
                In combination with your email before it would like this:

                Code:
                SendMail ("[email protected]","[email protected]", Instrument.MasterInstrument.Name,"Buy this equity on chart: " +  Bars.Period.Value.ToString() + Bars.Period.Id.ToString());
                in the email it would look like this:
                Code:
                Buy this equity on chart: 1 Minute
                Please let me know if I may be of additional assistance.
                JesseNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by jeronymite, 04-12-2024, 04:26 PM
                3 responses
                40 views
                0 likes
                Last Post jeronymite  
                Started by bill2023, Today, 08:51 AM
                2 responses
                15 views
                0 likes
                Last Post bill2023  
                Started by sidlercom80, 10-28-2023, 08:49 AM
                167 responses
                2,260 views
                0 likes
                Last Post jeronymite  
                Started by warreng86, 11-10-2020, 02:04 PM
                7 responses
                1,362 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by Perr0Grande, Today, 08:16 PM
                0 responses
                5 views
                0 likes
                Last Post Perr0Grande  
                Working...
                X