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

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.

    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.

        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.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Sparkyboy, Today, 10:57 AM
            0 responses
            2 views
            0 likes
            Last Post Sparkyboy  
            Started by TheMarlin801, 10-13-2020, 01:40 AM
            21 responses
            3,917 views
            0 likes
            Last Post Bidder
            by Bidder
             
            Started by timmbbo, 07-05-2023, 10:21 PM
            3 responses
            152 views
            0 likes
            Last Post grayfrog  
            Started by Lumbeezl, 01-11-2022, 06:50 PM
            30 responses
            810 views
            1 like
            Last Post grayfrog  
            Started by xiinteractive, 04-09-2024, 08:08 AM
            3 responses
            11 views
            0 likes
            Last Post NinjaTrader_Erick  
            Working...
            X