• 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 login_dejavu, Today, 02:22 AM
      1 response
      16 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by Leeroy_Jenkins, Yesterday, 09:17 AM
      1 response
      51 views
      0 likes
      Last Post NinjaTrader_Melissa  
      Started by chaitunt, 03-29-2020, 08:26 PM
      1 response
      14 views
      0 likes
      Last Post NinjaTrader_ChrisL  
      Started by mbcmbc, Yesterday, 11:01 PM
      2 responses
      17 views
      0 likes
      Last Post mbcmbc
      by mbcmbc
       
      Started by Zuhier Dourgham, Yesterday, 03:55 AM
      1 response
      30 views
      0 likes
      Last Post NinjaTrader_Jim  
      Working...
      X