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

Sending Email from a strategy

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

    Sending Email from a strategy

    Hi,

    I'm trying to send an email from a strategy.
    When I'm using the Tool>Option to send test email,l the email sent successfully.
    When I try to send it from the code using
    SendMail("[email protected]", "[email protected]", "Test", "Test");
    Nothing is sent.

    How can I fix it?

    Tx in advance!

    #2
    It works only in live. Not backtesting.

    Comment


      #3
      Thanks, Baruch. Yes, generally if the test email works than it does in code as well. SendMail will only work in real time so could be why you're not seeing it sent. If run on real time data, are there any errors messages in log tab of control center?
      Ryan M.NinjaTrader Customer Service

      Comment


        #4
        Thanks.
        Is there a way to check it on backtesting data? because in the email I collect data from the strategy and send it so I would like to test it in advance?

        Comment


          #5
          SendMail() does not work in backtesting / historical but you can record this information in a few different ways. Easiest is just with Print() and it will write to Tools > Output Window. You can copy / paste from this window and manually email. More advanced would be writing to a file:
          Ryan M.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by DJ888, 04-16-2024, 06:09 PM
          4 responses
          12 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by terofs, Today, 04:18 PM
          0 responses
          11 views
          0 likes
          Last Post terofs
          by terofs
           
          Started by nandhumca, Today, 03:41 PM
          0 responses
          7 views
          0 likes
          Last Post nandhumca  
          Started by The_Sec, Today, 03:37 PM
          0 responses
          3 views
          0 likes
          Last Post The_Sec
          by The_Sec
           
          Started by GwFutures1988, Today, 02:48 PM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Working...
          X