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 Shansen, 08-30-2019, 10:18 PM
              24 responses
              938 views
              0 likes
              Last Post spwizard  
              Started by Max238, Today, 01:28 AM
              0 responses
              3 views
              0 likes
              Last Post Max238
              by Max238
               
              Started by rocketman7, Today, 01:00 AM
              0 responses
              2 views
              0 likes
              Last Post rocketman7  
              Started by wzgy0920, 04-20-2024, 06:09 PM
              2 responses
              27 views
              0 likes
              Last Post wzgy0920  
              Started by wzgy0920, 02-22-2024, 01:11 AM
              5 responses
              32 views
              0 likes
              Last Post wzgy0920  
              Working...
              X