Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetTrailStop question

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

    SetTrailStop question

    I want to send email when SetTrailStop, SetStopLoss or SetProfitTarget fired. Is there a way to detect these events programmatically?
    How can I do this?

    Best Regards

    #2
    Hello aarcex,

    Thanks for your post and welcome to the forums.

    You would need to make sure you had e-mail set-up in your Ninjatrader: http://ninjatrader.com/support/helpG.../?misc_tab.htm

    In your code you would use the SendMail() method: http://ninjatrader.com/support/helpG.../?sendmail.htm

    In your code you would check for those order types, for example:

    Code:
    protected override void OnExecution(IExecution execution)
    		{
        		    if (execution.Name == "Stop loss")
             	      Print(string.Format("{0} - Stop loss was filled", execution.Time));
    			
    		    if (execution.Name == "Profit target")
    		      Print(string.Format("{0} - Profit Target was filled", execution.Time));	
    		}
    Please note that you cannot use SetTrailStop and SetStopLoss at the same time.
    http://ninjatrader.com/support/helpG...ttrailstop.htm Note the "Tips"

    Comment


      #3
      Hello Paul

      Thank you very much for your help
      I'll try your suggestions and comeback if i find additional problems

      Best Regards

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      571 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      330 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      549 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      549 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X