Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to get email notification when strategy executes a trade?

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

    How to get email notification when strategy executes a trade?

    I have a strategy running and I would like to get an email notification every time the strategy executes a trade.
    I am pretty sure I can code it myself inside the strategy using the "SendMail" function. But I would have to put it after every Enter/Exit call in the code.
    Is there maybe a more general approach to make NT generally send an email notification when a trade was executed?

    Thanks in advance!

    #2
    I had the same question. I found under the Tools > Options > Misc there was a spot for email info.

    Hope this helps

    GuppyDRV

    Comment


      #3
      Thanks, but I don't seem able to find it

      I don't find "Misc" under Options. I have there only General, Trading, Strategies, Automated trading interface and Market data.
      I did configure my Email-Account under General->Share services already and test-mail works fine.

      Comment


        #4
        Hello _vbs_,

        Thank you for your post.

        You could create a custom method that you call when you need to send mail or you would just copy and paste the SendMail() code in the places you need. The latter being the simplest solution.

        Comment


          #5
          Well, I had another idea where to put the code. I think this is a bit cleaner because it handles the Emails in one central place:

          Code:
          protected override void OnExecutionUpdate(Execution execution, string executionId, double price, int quantity, MarketPosition marketPosition, string orderId, DateTime time)
          {
          	if (State != State.Realtime)
          		return;
          			
          	SendMail("[email protected]", "Execution Filled", execution.ToString());
          }

          Comment


            #6
            Patrick,

            Thanks for the update without your support hat level of knowledge is beyond this non programs little brain.

            GuppyDRV

            Comment


              #7
              I just read in the documentation that SendMail is ignored until State is realtime. So the if-condition from my above post can be removed.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by DJ888, 04-16-2024, 06:09 PM
              6 responses
              18 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by Jon17, Today, 04:33 PM
              0 responses
              1 view
              0 likes
              Last Post Jon17
              by Jon17
               
              Started by Javierw.ok, Today, 04:12 PM
              0 responses
              6 views
              0 likes
              Last Post Javierw.ok  
              Started by timmbbo, Today, 08:59 AM
              2 responses
              10 views
              0 likes
              Last Post bltdavid  
              Started by alifarahani, Today, 09:40 AM
              6 responses
              41 views
              0 likes
              Last Post alifarahani  
              Working...
              X