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

Sendmail content

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

    Sendmail content

    Hello,

    I have a strategy that when if fires, I want the body of the email to show me the levels of some of the indicators, I want to show the low of the current candle minus 10 pips, I want to show the current level of the EMA 50 and the current level of the ADX 14, Here is my line of code, but I get error messages when I try and import the script, can you tell me where I am going wrong with the code?

    SendMail("[email protected]", "[email protected]", "EMA Storm LONG M5 " + Instrument.FullName + Time[0], (High[0] + 10*TickSize).ToString() + ": entry point", EMA(50).ToString() + ": EMA 50 level.", ADX(14).ToString() + ": ADX 14 level." );

    #2
    Jim, you passed in too many arguments - SendMail() takes 4 (from, to, subject and body text). This below should compile -

    Code:
    SendMail("[email protected]", "[email protected]", "EMA Storm LONG M5 " + Instrument.FullName + Time[0],  (High[0] + 10*TickSize).ToString() + ": entry point" + EMA(50).ToString() + ": EMA 50 level." + ADX(14).ToString() + ": ADX 14 level." );
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Results

      Hi, Here is my line of code:

      SendMail("[email protected]", "[email protected]", "EMA Storm LONG M5 " + Instrument.FullName + Time[0], (High[0] + 10*TickSize).ToString() + ": entry point." + EMA(50).ToString() + ": EMA 50 level." + ADX(14).ToString() + ": ADX 14 level.");

      And here is the email result:

      130.2: entry point.EMA(Close,50): EMA 50 level.ADX(14): ADX 14 level.

      So it isn't showing me the actula values for the EMA 50 and the ADX 14? What am I missing?

      Thanks,
      Jim

      Comment


        #4
        Sorry, please try the snippet below would it work better?

        Code:
        SendMail("[email protected]", "[email protected]", "EMA Storm LONG M5 " + Instrument.FullName + Time[0],  (High[0] + 10*TickSize).ToString() + ": entry point" + EMA(50)[0].ToString() + ": EMA 50 level." + ADX(14)[0].ToString() + ": ADX 14 level." );
        You would need to access a double values of the respective series (EMA and ADX).
        BertrandNinjaTrader Customer Service

        Comment


          #5
          too many decimal places

          Hello,

          Almost there with the results, I added the code as per your last reply, but now I get the following: (too many decimal places)

          0.6788: entry point...0.676264330268167: EMA 50 level...20.7701800939993: ADX 14 level.

          Here is the code:

          SendMail("[email protected]", "[email protected]", "EMA Storm SHORT M5 " + Instrument.FullName + Time[0], (Low[0] + -10*TickSize).ToString() + ": entry point..." + EMA(50)[0].ToString() + ": EMA 50 level..." + ADX(14)[0].ToString() + ": ADX 14 level.");

          Do I need to add the *TickSize statement, and if so, exactly what should it say?

          Thanks,
          Jim

          Comment


            #6
            Jim,

            You can just format your number to a certain number of decimal places with your .ToString() method. Please see here: http://www.ninjatrader.com/support/f...ead.php?t=3823
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by lorem, Today, 09:18 AM
            0 responses
            2 views
            0 likes
            Last Post lorem
            by lorem
             
            Started by hazylizard, Today, 08:38 AM
            4 responses
            11 views
            0 likes
            Last Post hazylizard  
            Started by geddyisodin, Today, 05:20 AM
            2 responses
            20 views
            0 likes
            Last Post geddyisodin  
            Started by Max238, Today, 01:28 AM
            5 responses
            47 views
            0 likes
            Last Post Max238
            by Max238
             
            Started by giulyko00, Yesterday, 12:03 PM
            3 responses
            13 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Working...
            X