• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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"
    Paul H.NinjaTrader Customer Service

    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 ericson, Today, 08:14 PM
      0 responses
      5 views
      0 likes
      Last Post ericson
      by ericson
       
      Started by user1986, Today, 07:28 PM
      1 response
      7 views
      0 likes
      Last Post user1986  
      Started by jertrade, Today, 06:57 PM
      0 responses
      5 views
      0 likes
      Last Post jertrade  
      Started by Emma1, Today, 02:42 PM
      1 response
      17 views
      0 likes
      Last Post NinjaTrader_DrewO  
      Started by fx.practic, Today, 03:10 PM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X