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 michi08, 10-05-2018, 09:31 AM
          5 responses
          741 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by The_Sec, Today, 02:29 PM
          0 responses
          2 views
          0 likes
          Last Post The_Sec
          by The_Sec
           
          Started by tsantospinto, 04-12-2024, 07:04 PM
          4 responses
          62 views
          0 likes
          Last Post aligator  
          Started by sightcareclickhere, Today, 01:55 PM
          0 responses
          1 view
          0 likes
          Last Post sightcareclickhere  
          Started by Mindset, 05-06-2023, 09:03 PM
          9 responses
          259 views
          0 likes
          Last Post ender_wiggum  
          Working...
          X