• 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

Emailing Bar Info

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

    Emailing Bar Info

    Hi,

    My indicator sends an email once a signal has been triggered. Is there any way to add the information of bar[0] such as Open, High, Low and Close? Is it also possible to send the same information for bar[1]

    This is the email i currently send;

    SendMail("[email protected]", Instrument.FullName + Time[0] + Bars.Period.Id + Bars.Period.Value, "Inside Bar");


    Thanks Rye

    #2
    Hello Rye,

    Thank you for your note.

    You can send this information within the string text (message body) of the e-mail using Close[0], Open[0], Low[0], and High[0]. And for the previous bar the same methods but with 1 instead of 0, like the following: Close[1], Open[1], etc.

    For example:
    Code:
    SendMail("[email protected]", "[email protected]", "OHLC of the current bar", Open[0] + " " + High[0] + " " + Low[0] + " " + Close[0]);
    For the previous bar:
    Code:
    SendMail("[email protected]", "[email protected]", "OHLC of the previous bar", Open[1] + " " + High[1] + " " + Low[1] + " " + Close[1]);
    For information on Close, Open, Low, and High please visit the following links:
    For information on referencing bars please visit the following link: http://www.ninjatrader.com/support/f...ead.php?t=4769

    Please let me know if I may be of further assistance.
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      Email OHLC

      Thanks Patrick but how do i enclose this all in one email. Can't compile it due to the number of arguments

      So i need this

      SendMail("[email protected]", Instrument.FullName + Time[0] + Bars.Period.Id + Bars.Period.Value, "Inside Bar");

      With this

      "OHLC of the current bar", Open[0] + " " + High[0] + " " + Low[0] + " " + Close[0]

      and

      "OHLC of the previous bar", Open[1] + " " + High[1] + " " + Low[1] + " " + Close[1]

      In one email message, can you help put this together?

      Comment


        #4
        Hello Rye,

        Thank you for your response.

        It would look like the following:
        Code:
        SendMail("[email protected]", "[email protected]", "OHLC of the current bar", Open[0] + " " + High[0] + " " + Low[0] + " " + Close[0] + " " + Open[1] + " " + High[1] + " " + Low[1] + " " + Close[1]);
        Notice that I am using the + to separate the values of the string (the OHLCs) and using the " " to add a space. You could even add in text here like the following:
        Code:
        SendMail("[email protected]", "[email protected]", "OHLC of the current bar", "Current Open: " + Open[0] + " Current High: " + High[0] + " Current Low: " + Low[0] + " Current Close: "  + Close[0] + " Previous Open: " + Open[1] + " Previous High: " + High[1] + " Previous Low: " + Low[1] + " Previous Close: " + Close[1]);
        Please let me know if I may be of further assistance.
        Patrick H.NinjaTrader Customer Service

        Comment


          #5
          Looks good but we're still missing the following

          Instrument.FullName + Time[0] + Bars.Period.Id + Bars.Period.Value

          Comment


            #6
            Hello Rye,

            Thank you for your response.

            The examples below are to be used as reference. So if " Instrument.FullName + Time[0] + Bars.Period.Id + Bars.Period.Value" is your subject line then you need to enter it into the section for the string subject.

            For example this is the syntax for SendMail(): SendMail(string from, string to, string subject, string text)

            With your subject entered into the example it would look like the following: SendMail(string from, string to, Instrument.FullName + Time[0] + Bars.Period.Id + Bars.Period.Value, string text)

            Please use the information at the following link on SendMail() to ensure you are using the proper Syntax: http://www.ninjatrader.com/support/h...7/sendmail.htm

            Please let me know if I may be of further assistance.
            Patrick H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by rontronimous, Today, 05:55 PM
            0 responses
            8 views
            0 likes
            Last Post rontronimous  
            Started by bcgeek, Today, 03:43 PM
            2 responses
            6 views
            0 likes
            Last Post bcgeek
            by bcgeek
             
            Started by Mberg, Today, 04:05 PM
            0 responses
            9 views
            0 likes
            Last Post Mberg
            by Mberg
             
            Started by dkbyond, Today, 03:52 PM
            0 responses
            5 views
            0 likes
            Last Post dkbyond
            by dkbyond
             
            Started by Newtrader101, Today, 03:09 PM
            2 responses
            7 views
            0 likes
            Last Post Newtrader101  
            Working...
            X