Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sending Variables via email/txt

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

    Sending Variables via email/txt

    I am trying to send either a variable or the last price with sendmail(). I have the following:

    Code:
    SendMail("[email protected]", "[email protected]", "Price above XUP Low ","Greater than " + xUPlow);
    It works BUT the value, say 1.3675, gets cut off in the text somehow and ends up being "Greater than 1"

    Anyway to fix that? What would I substitute in order to send the last traded price?

    #2
    RDPoS, have you tried formatting the variable explicitly to a string offering the various C# format options as shown here?

    BertrandNinjaTrader Customer Service

    Comment


      #3
      Oddly, it worked in all successive attempts. I think the rounding off to no significant digits threw me off.

      So the only issue remaining is what code to use to send the last price.

      Comment


        #4
        You can use the Close[0] value if the strategy is ran on CalculateOnBarClose = false.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          So what about if it is CalculateOnBarClose = true ?

          Comment


            #6
            If you are using CalculateOnBarClose = true, you do not have access to the current price. You have access to the last complete bar's close price and that is the latest information available to you since you are only calculating at the close of each bar. To get anything more updated than that you need to use CalculateOnBarClose = false or try to grab it off OnMarketData() events.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Thank you sir.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by GussJ, 03-04-2020, 03:11 PM
              16 responses
              3,281 views
              0 likes
              Last Post Leafcutter  
              Started by WHICKED, Today, 12:45 PM
              2 responses
              19 views
              0 likes
              Last Post WHICKED
              by WHICKED
               
              Started by Tim-c, Today, 02:10 PM
              1 response
              9 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by Taddypole, Today, 02:47 PM
              0 responses
              5 views
              0 likes
              Last Post Taddypole  
              Started by chbruno, 04-24-2024, 04:10 PM
              4 responses
              53 views
              0 likes
              Last Post chbruno
              by chbruno
               
              Working...
              X