Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sending an email on strategy end

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

    Sending an email on strategy end

    I've tried to set this up such that on state terminated, I send myself an email - but it sends way too many.

    How should I do this in order to email myself a notification if the strategy has ended, due to error or anything else? Is there a simple solution that can utilize the shareservice feature?

    #2
    Hello Skifree,

    State.Terminated is called for many different reasons in a strategies lifecycle. To know the terminated state only when the strategy has ended you would need to use a variable to know the strategy was started. You can read about the lifecycle of a script here: https://ninjatrader.com/support/help...fecycle_of.htm

    You can see the sample on that page that starts with //custom flag to help time termination logic. That would be the same process you would need to do in order to catch only the last terminated after the strategy was active. In State.Historical set the bool to true to know the strategy was running and then check for that in State.Terminated.





    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    87 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    118 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X